"use client";

import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog";
import { ContainerForm } from "@/modules/garden/components/container-form";

type Props = {
  open: boolean;
  onOpenChange: (open: boolean) => void;
};

export function ContainerCreateDialog({ open, onOpenChange }: Props) {
  return (
    <Dialog open={open} onOpenChange={onOpenChange}>
      <DialogContent className="sm:max-w-md max-h-[90dvh] overflow-y-auto">
        {open ? (
          <>
            <DialogHeader>
              <DialogTitle>Add container</DialogTitle>
            </DialogHeader>
            <ContainerForm
              onSuccess={() => onOpenChange(false)}
              onCancel={() => onOpenChange(false)}
            />
          </>
        ) : null}
      </DialogContent>
    </Dialog>
  );
}
