import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { type ReactNode, useState } from "react"; interface FormDialogProps { triggerLabel: string; title: string; children: (closeDialog: () => void) => ReactNode; } export function FormDialog({ triggerLabel, title, children }: FormDialogProps) { const [isOpen, setIsOpen] = useState(false); const closeDialog = () => setIsOpen(false); return ( {title} {children(closeDialog)} ); }