-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathTaskItem.tsx
More file actions
29 lines (27 loc) · 829 Bytes
/
TaskItem.tsx
File metadata and controls
29 lines (27 loc) · 829 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
import Check from "@/components/icons/Check";
import Circle from "@/components/icons/Circle";
import { Tables } from "../types/store.types";
import { toggleDone } from "../lib/store";
const TaskItem = ({ task }: { task: Tables<"tasks"> }) => {
const handlePress = () => {
toggleDone(task.id);
};
return (
<li className="bg-mobai-foreground p-3 sm:p-4 transition-all duration-500 ease-mobai-bounce">
<button
onClick={handlePress}
className="flex flex-row justify-between w-full items-center"
>
<p className="text-mobai-background font-bold">{task.text}</p>
<p>
{task.done ? (
<Check className="size-6" />
) : (
<Circle className="size-6" />
)}
</p>
</button>
</li>
);
};
export default TaskItem;