"use client"; import { useEffect, useState } from "react"; import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { PlantForm } from "@/modules/garden/components/plant-form"; import { listContainers, type ContainerDto } from "@/modules/garden/server/queries"; type Props = { open: boolean; onOpenChange: (open: boolean) => void; }; export function PlantCreateDialog({ open, onOpenChange }: Props) { return ( {open ? onOpenChange(false)} /> : null} ); } function PlantCreateForm({ onDone }: { onDone: () => void }) { const [containers, setContainers] = useState([]); useEffect(() => { listContainers() .then(setContainers) .catch(() => setContainers([])); }, []); return ( <> Add plant onDone()} onCancel={onDone} /> ); }