import { useState } from 'react'; import { Task } from '../hooks/useConversation'; interface Props { tasks: Task[]; addTask: (text: string) => void; } export default function TaskList({ tasks, addTask }: Props) { const [input, setInput] = useState(''); const pending = tasks.filter((t) => !t.completed); const done = tasks.filter((t) => t.completed); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (!input.trim()) return; addTask(input.trim()); setInput(''); }; return (

Tasks {pending.length > 0 && ( {pending.length} )}

setInput(e.target.value)} placeholder="add a task..." className="flex-1 bg-white/30 border border-kira-pink/20 rounded-lg px-2 py-1 text-xs text-kira-plum placeholder:text-kira-plum/30 focus:outline-none focus:border-kira-pink/50" />
{tasks.length === 0 && (
tell Kira or type a task above!
)} {pending.length > 0 && ( )} {done.length > 0 && ( )}
); }