2021-10-28 17:48:53 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Text, View } from 'react-native';
|
|
|
|
import { Tasks as TasksProps } 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 ITasksProps {
|
|
|
|
value: TasksProps['value'];
|
|
|
|
}
|
|
|
|
|
2022-03-29 18:53:10 +00:00
|
|
|
const TaskList = ({ value = [] }: ITasksProps) => {
|
2021-10-28 17:48:53 +00:00
|
|
|
const { theme } = useTheme();
|
|
|
|
return (
|
|
|
|
<View>
|
|
|
|
{value.map(item => (
|
|
|
|
<View style={styles.row}>
|
2022-03-29 18:53:10 +00:00
|
|
|
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{item.status ? '- [x] ' : '- [ ] '}</Text>
|
2021-10-28 17:48:53 +00:00
|
|
|
<Inline value={item.value} />
|
|
|
|
</View>
|
|
|
|
))}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TaskList;
|