import { PrinterForm } from "@/app/admin/printers/form";
import { DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import type { InferResultType } from "@/utils/drizzle";

interface EditPrinterDialogTriggerProps {
	children: React.ReactNode;
}

export function EditPrinterDialogTrigger(props: EditPrinterDialogTriggerProps) {
	const { children } = props;

	return <DialogTrigger asChild>{children}</DialogTrigger>;
}

interface EditPrinterDialogContentProps {
	printer: InferResultType<"printers">;
	setOpen: (open: boolean) => void;
}
export function EditPrinterDialogContent(props: EditPrinterDialogContentProps) {
	const { printer, setOpen } = props;

	return (
		<DialogContent>
			<DialogHeader>
				<DialogTitle>Drucker bearbeiten</DialogTitle>
			</DialogHeader>
			<PrinterForm setOpen={setOpen} printer={printer} />
		</DialogContent>
	);
}
