2021-10-20 16:32:58 +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';
|
|
|
|
import { useTheme } from '../../../theme';
|
2024-02-07 21:03:03 +00:00
|
|
|
import { CustomIcon } from '../../CustomIcon';
|
2021-10-20 16:32:58 +00:00
|
|
|
|
|
|
|
interface ITasksProps {
|
|
|
|
value: TasksProps['value'];
|
|
|
|
}
|
|
|
|
|
2022-03-25 17:20:09 +00:00
|
|
|
const TaskList = ({ value = [] }: ITasksProps) => {
|
2023-02-16 13:07:19 +00:00
|
|
|
const { colors } = useTheme();
|
2021-10-20 16:32:58 +00:00
|
|
|
return (
|
|
|
|
<View>
|
|
|
|
{value.map(item => (
|
|
|
|
<View style={styles.row}>
|
2024-04-18 10:19:54 +00:00
|
|
|
<Text style={[styles.text, { color: colors.fontDefault }]}>
|
2024-02-07 21:03:03 +00:00
|
|
|
<CustomIcon
|
|
|
|
testID={item.status ? 'task-list-checked' : 'task-list-unchecked'}
|
|
|
|
name={item.status ? 'checkbox-checked' : 'checkbox-unchecked'}
|
|
|
|
size={24}
|
|
|
|
/>
|
|
|
|
</Text>
|
2024-04-18 10:19:54 +00:00
|
|
|
<Text style={[styles.inline, { color: colors.fontDefault }]}>
|
2023-02-16 13:07:19 +00:00
|
|
|
<Inline value={item.value} />
|
|
|
|
</Text>
|
2021-10-20 16:32:58 +00:00
|
|
|
</View>
|
|
|
|
))}
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TaskList;
|