'use client'; import { useRouter } from 'next/navigation'; import { useDeleteProject } from '@/lib/hooks/use-projects'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from '@/components/ui/dialog'; import { Button } from '@/components/ui/button'; import { toast } from 'sonner'; interface ArchiveProjectDialogProps { projectId: string; projectName: string; open: boolean; onOpenChange: (open: boolean) => void; } export function ArchiveProjectDialog({ projectId, projectName, open, onOpenChange, }: ArchiveProjectDialogProps) { const router = useRouter(); const deleteProject = useDeleteProject(); const handleArchive = async () => { try { await deleteProject.mutateAsync(projectId); toast.success('Project archived successfully'); router.push('/projects'); } catch (error) { toast.error('Failed to archive project'); console.error('Archive error:', error); } }; return ( Archive Project Are you sure you want to archive{' '} {projectName}?

This action will mark the project as archived, but it can be restored later. All associated issues and data will be preserved.

); }