From 2478f1a91ee1c8fb224ae433dc3522c601add81d Mon Sep 17 00:00:00 2001 From: ngc2207 Date: Tue, 12 Nov 2024 15:47:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=89=87=E6=AE=B5=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=9C=A8=E5=B1=95=E7=A4=BA=E9=A1=B5=E9=9D=A2=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=BC=96=E8=BE=91=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/snippets/[id]/edit/page.tsx | 11 +++++++++++ src/app/snippets/[id]/page.tsx | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/app/snippets/[id]/edit/page.tsx diff --git a/src/app/snippets/[id]/edit/page.tsx b/src/app/snippets/[id]/edit/page.tsx new file mode 100644 index 0000000..9f16eff --- /dev/null +++ b/src/app/snippets/[id]/edit/page.tsx @@ -0,0 +1,11 @@ +interface SnippetEditPageProps { + params: Promise<{ + id: string; + }>; +} + +export default async function SnippetEditPage(props: SnippetEditPageProps) { + const params = await props.params; + const id = parseInt(params.id); + return
Editing snippet with id {id}
; +} diff --git a/src/app/snippets/[id]/page.tsx b/src/app/snippets/[id]/page.tsx index 120b124..5b191f6 100644 --- a/src/app/snippets/[id]/page.tsx +++ b/src/app/snippets/[id]/page.tsx @@ -1,4 +1,5 @@ import { db } from "@/db"; +import Link from "next/link"; import { notFound } from "next/navigation"; interface SnippetShowPageProps { @@ -26,7 +27,12 @@ export default async function SnippetShowPage(props: SnippetShowPageProps) {

{snippet.title}

- + + Edit +