Files
Todo/components/NewListButton.tsx
Paul Bailey c1afb2cb6e feat: enhance list management UI with create, edit, and delete functionality
- Add ListForm component for creating and editing lists with color picker
- Add Modal component for reusable dialog functionality
- Add DeleteListButton with confirmation dialog
- Add NewListButton for creating new lists
- Update ListCard to show edit/delete buttons on hover
- Update home page to use new list creation flow
- All components include proper error handling and loading states

Requirements: 2.1, 2.2, 2.4, 2.5
2025-12-01 19:18:54 +00:00

34 lines
809 B
TypeScript

'use client'
import { useState } from 'react'
import { PlusIcon } from 'lucide-react'
import Modal from './Modal'
import ListForm from './ListForm'
export default function NewListButton() {
const [isModalOpen, setIsModalOpen] = useState(false)
return (
<>
<button
onClick={() => setIsModalOpen(true)}
className="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-colors"
>
<PlusIcon size={20} />
New List
</button>
<Modal
isOpen={isModalOpen}
onClose={() => setIsModalOpen(false)}
title="Create New List"
>
<ListForm
onCancel={() => setIsModalOpen(false)}
onSuccess={() => setIsModalOpen(false)}
/>
</Modal>
</>
)
}