import type { RouterOutputs } from '@/server/api/types' type Todo = RouterOutputs['todo']['list'][number] interface TodoItemProps { todo: Todo onToggle: (id: string, completed: boolean) => void onDelete: (id: string) => void } export const TodoItem = ({ todo, onToggle, onDelete }: TodoItemProps) => { return (

{todo.title}

{new Date(todo.createdAt).toLocaleDateString('zh-CN')}
) }