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
This commit is contained in:
33
components/NewListButton.tsx
Normal file
33
components/NewListButton.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
'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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user