import { memo } from 'react' import { ArrowRight, Check, ClipboardList, Circle } from 'lucide-react' import { cn } from '@/utils/cn' import { useNovaKit } from '../../context/useNovaKit' export interface TodoItem { id?: string | number title?: string status?: 'pending' | 'completed' | 'in_progress' | string [key: string]: unknown } export interface TodoListProps { items: TodoItem[] className?: string } function TodoListComponent({ items = [], className }: TodoListProps) { const { agentName } = useNovaKit() const todoItems = items const totalCount = todoItems.length const completedCount = todoItems.filter(item => item.status === 'completed').length const isAllCompleted = totalCount > 0 && completedCount === totalCount const displayCompletedCount = totalCount === 0 ? 0 : Math.min(totalCount, isAllCompleted ? completedCount : completedCount + 1) const progressRatio = totalCount === 0 ? 0 : displayCompletedCount / totalCount const progressPercent = Math.max(0, Math.min(100, progressRatio * 100)) return (
{agentName}
{item.title as string}
{typeof (item as any).description === 'string' && ({(item as any).description as string}
)}