diff --git a/todo-app/src/app/components/AddTodoForm.tsx b/todo-app/src/app/components/AddTodoForm.tsx new file mode 100644 index 0000000..4e29dbb --- /dev/null +++ b/todo-app/src/app/components/AddTodoForm.tsx @@ -0,0 +1,42 @@ +'use client'; + +import { useState } from 'react'; + +interface AddTodoFormProps { + onAdd: (title: string) => void; + isLoading?: boolean; +} + +export default function AddTodoForm({ onAdd, isLoading = false }: AddTodoFormProps) { + const [title, setTitle] = useState(''); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (title.trim()) { + onAdd(title.trim()); + setTitle(''); + } + }; + + return ( +
+ ); +} diff --git a/todo-app/src/app/components/DeleteConfirmationModal.tsx b/todo-app/src/app/components/DeleteConfirmationModal.tsx new file mode 100644 index 0000000..a9170ec --- /dev/null +++ b/todo-app/src/app/components/DeleteConfirmationModal.tsx @@ -0,0 +1,51 @@ +'use client'; + +interface DeleteConfirmationModalProps { + isOpen: boolean; + onConfirm: () => void; + onCancel: () => void; + todoTitle: string; +} + +export default function DeleteConfirmationModal({ + isOpen, + onConfirm, + onCancel, + todoTitle +}: DeleteConfirmationModalProps) { + if (!isOpen) return null; + + return ( ++ Are you sure you want to delete "{todoTitle}"? This action cannot be undone. +
++ No todos yet. Add one above to get started! +
+ ) : ( +