diff --git a/src/app/di-tich/[slug]/page.tsx b/src/app/di-tich/[slug]/page.tsx new file mode 100644 index 0000000..f26b316 --- /dev/null +++ b/src/app/di-tich/[slug]/page.tsx @@ -0,0 +1,93 @@ +import type { Metadata } from "next"; +import Image from "next/image"; +import Link from "next/link"; +import { notFound } from "next/navigation"; +import { ArrowLeft, MapPin, PlayCircle, Tag } from "lucide-react"; +import { BackToTopButton } from "@/app/components/landing/BackToTopButton"; +import { SiteFooter } from "@/app/components/landing/SiteFooter"; +import { SiteHeader } from "@/app/components/landing/SiteHeader"; +import { heritageSites } from "@/app/content"; + +export function generateStaticParams() { + return heritageSites.map((site) => ({ slug: site.id })); +} + +export async function generateMetadata({ + params, +}: { + params: Promise<{ slug: string }>; +}): Promise { + const { slug } = await params; + const site = heritageSites.find((s) => s.id === slug); + if (!site) return { title: "Không tìm thấy di tích | VR360 Như Quỳnh" }; + return { + title: `${site.name} | VR360 Như Quỳnh`, + description: site.shortDescription, + }; +} + +export default async function HeritageDetailPage({ + params, +}: { + params: Promise<{ slug: string }>; +}) { + const { slug } = await params; + const site = heritageSites.find((s) => s.id === slug); + if (!site) notFound(); + + const paragraphs = site.longDescription ?? [site.shortDescription]; + + return ( +
+ + +
+ {site.name} +
+ + + Tất cả di tích + +
+
+ {site.level} + {site.type} + {site.status} +
+

+ {site.name} +

+ {site.location ? ( +

+ + {site.location} +

+ ) : null} +
+
+
+ +
+
+ {paragraphs.map((text, i) => ( +

{text}

+ ))} +
+ + {site.isAvailable && site.vrUrl ? ( + + + Tham quan VR360 + + ) : ( +

+ Tư liệu VR360 cho di tích này đang được bổ sung và sẽ sớm ra mắt. +

+ )} +
+ + + +
+ ); +}