"use client" import { Button } from "@repo/ui/components/button" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@repo/ui/components/dialog" import { Input } from "@repo/ui/components/input" import { Loader2 } from "lucide-react" import { AnimatePresence, motion } from "motion/react" import { useState } from "react" import { useProjectMutations } from "@/hooks/use-project-mutations" interface CreateProjectDialogProps { open: boolean onOpenChange: (open: boolean) => void } export function CreateProjectDialog({ open, onOpenChange, }: CreateProjectDialogProps) { const [projectName, setProjectName] = useState("") const { createProjectMutation } = useProjectMutations() const handleClose = () => { onOpenChange(false) setProjectName("") } const handleCreate = () => { if (projectName.trim()) { createProjectMutation.mutate( { name: projectName }, { onSuccess: () => { handleClose() }, }, ) } } return ( {open && ( Create New Project Give your project a unique name
setProjectName(e.target.value)} onKeyDown={(e) => { if (e.key === "Enter" && projectName.trim()) { handleCreate() } }} placeholder="My Awesome Project" value={projectName} />

This will help you organize your memories

)}
) }