19 lines
774 B
TypeScript
19 lines
774 B
TypeScript
import { notFound } from "next/navigation";
|
|
import { DetailBackLink } from "@/components/detail-back-link";
|
|
import { PlantForm } from "@/modules/garden/components/plant-form";
|
|
import { getPlant, listContainers } from "@/modules/garden/server/queries";
|
|
|
|
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">
|
|
<DetailBackLink href={`/garden/plants/${plant.id}`} label={plant.name} className="mb-3" />
|
|
<h1 className="page-title">Edit Plant</h1>
|
|
<PlantForm existingPlant={plant} containers={containers} />
|
|
</div>
|
|
);
|
|
}
|