verdnatura-chat/app/containers/markdown/new/OrderedList.tsx

28 lines
720 B
TypeScript
Raw Normal View History

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';
import { useTheme } from '../../../theme';
interface IOrderedListProps {
value: OrderedListProps['value'];
}
const OrderedList = ({ value }: IOrderedListProps): React.ReactElement => {
const { colors } = useTheme();
2021-10-28 17:48:53 +00:00
return (
<View>
{value.map(item => (
<View style={styles.row} key={item.number?.toString()}>
<Text style={[styles.text, { color: colors.bodyText }]}>{item.number}. </Text>
2021-10-28 17:48:53 +00:00
<Inline value={item.value} />
</View>
))}
</View>
);
};
export default OrderedList;