- perenual species lookup with 24h db cache (api key optional) - /api/garden/species-search route handler - createPlant / updatePlant / deletePlant server actions - addPlantImage / removePlantImage / setPrimaryImage actions (max 10) - listPlants query grouped by container with last-watered subquery - getPlant query with care log summary and active schedules - plant-form client component with species autofill and image upload - plant-list server component grouped by container with unassigned bucket - plant-detail client component with info/gallery/care tabs - species-search debounced combobox component - /garden/plants/new, /[id], /[id]/edit pages - garden.plant entity registered with search and share support - /garden page updated to containers/plants tabs (default: containers)
17 lines
613 B
TypeScript
17 lines
613 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { getPlant, listContainers } from "@/modules/garden/server/queries";
|
|
import { PlantForm } from "@/modules/garden/components/plant-form";
|
|
|
|
export default async function EditPlantPage({ params }: { params: Promise<{ id: string }> }) {
|
|
const { id } = await params;
|
|
const [plant, containers] = await Promise.all([getPlant(id), listContainers()]);
|
|
if (!plant) notFound();
|
|
|
|
return (
|
|
<div className="page-content max-w-xl">
|
|
<h1 className="page-title">Edit Plant</h1>
|
|
<PlantForm existingPlant={plant} containers={containers} />
|
|
</div>
|
|
);
|
|
}
|