2021-10-20 16:32:58 +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';
|
|
|
|
import { useTheme } from '../../../theme';
|
|
|
|
|
|
|
|
interface IOrderedListProps {
|
|
|
|
value: OrderedListProps['value'];
|
|
|
|
}
|
|
|
|
|
2022-03-25 17:20:09 +00:00
|
|
|
const OrderedList = ({ value }: IOrderedListProps) => {
|
2022-06-27 21:27:22 +00:00
|
|
|
const { colors } = useTheme();
|
2021-10-20 16:32:58 +00:00
|
|
|
return (
|
|
|
|
<View>
|
|
|
|
{value.map((item, index) => (
|
|
|
|
<View style={styles.row}>
|
2022-06-27 21:27:22 +00:00
|
|
|
<Text style={[styles.text, { color: colors.bodyText }]}>{index + 1}. </Text>
|
2021-10-20 16:32:58 +00:00
|
|
|
<Inline value={item.value} />
|
|
|
|
</View>
|
|
|
|
))}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OrderedList;
|