-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTodoCard.tsx
More file actions
30 lines (28 loc) · 896 Bytes
/
TodoCard.tsx
File metadata and controls
30 lines (28 loc) · 896 Bytes
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
import EmptyCircleIcon from "../icons/EmptyCircleIcon"
import CheckIcon from "../icons/CheckIcon"
function Item({todo, isCompleted }: {todo: string;isCompleted: boolean;}) {
return(
<div>
{isCompleted ? (
<div className= "flex items-center gap-[12px] text-[#1F2937] opacity-50">
<CheckIcon />
<del>{todo}</del>
</div>
) : (
<div className= "flex items-center gap-[12px] text-[#1F2937]">
<EmptyCircleIcon />
<span>{todo}</span>
</div>
)}
</div>
)
}
export default function TodoCard({todo, isCompleted }: {todo: string;isCompleted: boolean;}) {
return (
<li className="flex w-full items-center gap-[10px] p-4 rounded-[12px] bg-white shadow-sm">
<p className="text-[14px] leading-[21px] text-[#1F2937]">
<Item todo={todo} isCompleted={isCompleted} />
</p>
</li>
)
}