import { useState } from "react"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger, DialogFooter, DialogClose, } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { useCreateAlbum } from "@/features/albums/use-albums"; import { Plus } from "lucide-react"; export function CreateAlbumDialog() { const [isOpen, setIsOpen] = useState(false); const { mutate: createAlbum, isPending } = useCreateAlbum(); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); const formData = new FormData(e.currentTarget); const name = formData.get("name") as string; const description = formData.get("description") as string; if (name) { createAlbum( { name, description }, { onSuccess: () => { setIsOpen(false); // TODO: Add toast }, } ); } }; return (
Create New Album Give your new album a name and description.