diff --git a/src/app/garden/containers/[id]/page.tsx b/src/app/garden/containers/[id]/page.tsx new file mode 100644 index 0000000..b7c3edc --- /dev/null +++ b/src/app/garden/containers/[id]/page.tsx @@ -0,0 +1,14 @@ +import { notFound } from "next/navigation"; +import { getContainer } from "@/modules/garden/server/queries"; +import { ContainerDetail } from "@/modules/garden/components/container-detail"; + +export default async function ContainerPage({ params }: { params: Promise<{ id: string }> }) { + const { id } = await params; + const container = await getContainer(id); + if (!container) notFound(); + return ( +
+ +
+ ); +} diff --git a/src/app/garden/containers/new/page.tsx b/src/app/garden/containers/new/page.tsx new file mode 100644 index 0000000..c5ecfe3 --- /dev/null +++ b/src/app/garden/containers/new/page.tsx @@ -0,0 +1,70 @@ +import { redirect } from "next/navigation"; +import { createContainer } from "@/modules/garden/server/actions"; + +export default function NewContainerPage() { + async function handleCreate(formData: FormData) { + "use server"; + await createContainer({ + name: formData.get("name") as string, + type: (formData.get("type") as string) || "other", + locationNotes: (formData.get("locationNotes") as string) || null, + }); + redirect("/garden"); + } + + return ( +
+

New container

+
+
+ + +
+
+ + +
+
+ +