From 3a73f27cea17731d339891683ef8b24ab4456d49 Mon Sep 17 00:00:00 2001 From: hamster1963 <1410514192@qq.com> Date: Thu, 17 Oct 2024 23:45:18 +0800 Subject: [PATCH] feat: add detail page --- app/[locale]/(main)/detail/[id]/page.tsx | 7 ++++ components/ServerCard.tsx | 52 +++++++++++++----------- 2 files changed, 35 insertions(+), 24 deletions(-) create mode 100644 app/[locale]/(main)/detail/[id]/page.tsx diff --git a/app/[locale]/(main)/detail/[id]/page.tsx b/app/[locale]/(main)/detail/[id]/page.tsx new file mode 100644 index 0000000..47d32f6 --- /dev/null +++ b/app/[locale]/(main)/detail/[id]/page.tsx @@ -0,0 +1,7 @@ +export default function Page({ params }: { params: { id: string } }) { + return ( +
+ {params.id} +
+ ); +} diff --git a/components/ServerCard.tsx b/components/ServerCard.tsx index a1a6ec7..b7af3d9 100644 --- a/components/ServerCard.tsx +++ b/components/ServerCard.tsx @@ -36,35 +36,39 @@ export default function ServerCard({ "flex flex-col items-center justify-start gap-3 p-3 md:px-5 lg:flex-row" } > - + {/* -
- -
- {showFlag ? : null} -
-

- {name} -

-
+
-
+
*/} +
{ + router.push(`/${locale}/detail/${id}`); + }} + > +
+ {showFlag ? : null} +
+

+ {name} +

+ +
{ router.push(`/${locale}/${id}`);