-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.tsx
37 lines (34 loc) · 852 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react'
import { List, Typography, Space } from 'antd'
import { CheckCircleTwoTone } from '@ant-design/icons'
type Todo = {
id: number
contents: string
finished: boolean
}
type Props = {
isLoading?: boolean
todos: Todo[]
}
export const Todos: React.VFC<Props> = ({ todos, isLoading }) => {
return (
<List
size="large"
loading={isLoading}
dataSource={todos}
renderItem={({ id, contents, finished }) => (
<List.Item key={id}>
<Typography.Title>
<Space>
<CheckCircleTwoTone
twoToneColor={finished ? '#52c41a' : '#e3e3e3'}
/>
{contents}
</Space>
</Typography.Title>
{/* <Typography.Title level={5}>{contents}</Typography.Title> */}
</List.Item>
)}
/>
)
}