2021-10-28 17:48:53 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { View, Text } from 'react-native';
|
|
|
|
import { OrderedList as OrderedListProps } from '@rocket.chat/message-parser';
|
|
|
|
|
|
|
|
import Inline from './Inline';
|
|
|
|
import styles from '../styles';
|
2022-04-28 18:45:00 +00:00
|
|
|
import { themes } from '../../../lib/constants';
|
2021-10-28 17:48:53 +00:00
|
|
|
import { useTheme } from '../../../theme';
|
|
|
|
|
|
|
|
interface IOrderedListProps {
|
|
|
|
value: OrderedListProps['value'];
|
|
|
|
}
|
|
|
|
|
2022-03-29 18:53:10 +00:00
|
|
|
const OrderedList = ({ value }: IOrderedListProps) => {
|
2021-10-28 17:48:53 +00:00
|
|
|
const { theme } = useTheme();
|
|
|
|
return (
|
|
|
|
<View>
|
|
|
|
{value.map((item, index) => (
|
|
|
|
<View style={styles.row}>
|
2022-03-29 18:53:10 +00:00
|
|
|
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{index + 1}. </Text>
|
2021-10-28 17:48:53 +00:00
|
|
|
<Inline value={item.value} />
|
|
|
|
</View>
|
|
|
|
))}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OrderedList;
|