"use client";

import { PrinterForm } from "@/app/admin/printers/form";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog";
import { useState } from "react";

interface CreatePrinterDialogProps {
	children: React.ReactNode;
}

export function CreatePrinterDialog(props: CreatePrinterDialogProps) {
	const { children } = props;
	const [open, setOpen] = useState(false);

	return (
		<Dialog open={open} onOpenChange={setOpen}>
			<DialogTrigger asChild>{children}</DialogTrigger>
			<DialogContent>
				<DialogHeader>
					<DialogTitle>Drucker erstellen</DialogTitle>
				</DialogHeader>
				<PrinterForm setOpen={setOpen} />
			</DialogContent>
		</Dialog>
	);
}
