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-08-11 14:30:11 +00:00
|
|
|
const OrderedList = ({ value }: IOrderedListProps): React.ReactElement => {
|
|
|
|
const { colors } = useTheme();
|
2021-10-20 16:32:58 +00:00
|
|
|
return (
|
|
|
|
<View>
|
2022-08-11 14:30:11 +00:00
|
|
|
{value.map(item => (
|
|
|
|
<View style={styles.row} key={item.number?.toString()}>
|
2024-04-18 10:19:54 +00:00
|
|
|
<Text style={[styles.text, styles.listPrefix, { color: colors.fontDefault }]}>{item.number}. </Text>
|
|
|
|
<Text style={[styles.text, styles.inline, { color: colors.fontDefault }]}>
|
2022-11-30 18:35:17 +00:00
|
|
|
<Inline value={item.value} />
|
|
|
|
</Text>
|
2021-10-20 16:32:58 +00:00
|
|
|
</View>
|
|
|
|
))}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default OrderedList;
|