diff --git a/src/common/CheckList.tsx b/src/common/CheckList.tsx index 69c4bb1..fc72636 100644 --- a/src/common/CheckList.tsx +++ b/src/common/CheckList.tsx @@ -13,7 +13,7 @@ import Plus from '@assets/icons/plus.svg?react'; import BookMarkIcon from '@assets/icons/bookmark.svg?react'; import { useUpdateTodoMutation } from '@hook/todo/useUpdateTodoMutation.ts'; -type ChecklistItem = string | { id?: number; text: string }; +type ChecklistItem = string | { id?: number; text: string; saveCount?: number }; interface CheckListProps { lists: ChecklistItem[]; @@ -21,6 +21,7 @@ interface CheckListProps { className?: string; onChange?: (checkedIds: number[]) => void; showAddButton?: boolean; + saveCount?: number; } const CheckList = ({ @@ -34,7 +35,7 @@ const CheckList = ({ const isMyToPage = location.pathname.startsWith('/mytodo/list'); const { mutate: updateTodo } = useUpdateTodoMutation(); const normalized = lists.map((item) => - typeof item === 'string' ? { text: item } : item + typeof item === 'string' ? { text: item, saveCount: 0 } : item ); const [editIndex, setEditIndex] = useState(null); @@ -264,7 +265,9 @@ const CheckList = ({ <>
- 999 + + {item.saveCount ?? 0} +