import Blocks from "@/components/blocks"; import { fetchSanityPageBySlug, fetchSanitySettings } from "@/sanity/lib/fetch"; import { generatePageMetadata } from "@/sanity/lib/metadata"; import { AboutView } from "@/components/templates"; import { getDynamicFetchOptions, sanityFetchMetadata, type DynamicFetchOptions, } from "@/sanity/lib/live"; import { PAGE_QUERY_RESULT } from "@/sanity.types"; import { PAGE_QUERY } from "@/sanity/queries/page"; import { draftMode } from "next/headers"; import { Suspense } from "react"; function PageFallback() { return (
); } export async function generateMetadata() { try { const { perspective } = await getDynamicFetchOptions(); const { data: page } = (await sanityFetchMetadata({ query: PAGE_QUERY, params: { slug: "about" }, perspective, })) as { data: PAGE_QUERY_RESULT }; if (page) { return generatePageMetadata({ page, slug: "about" }); } } catch (err) { // Ignore when offline or unconfigured } return { title: "About Vietnam Wedding Guide | Platform Vision, Experiential Tourism & Cultural Bridge", description: "Vietnam Wedding Guide (VWG) champions high-value experiential tourism and cross-cultural understanding through destination weddings, celebrating Vietnam's destinations, warm hospitality, world-class culinary arts, and local creative mastery.", }; } export default async function AboutPage() { const { isEnabled: isDraftMode } = await draftMode(); if (isDraftMode) { return ( }> ); } return ; } async function DynamicAboutPage() { const { perspective, stega } = await getDynamicFetchOptions(); return ; } async function CachedAboutPage({ perspective, stega }: DynamicFetchOptions) { const [page, settings] = await Promise.all([ fetchSanityPageBySlug({ slug: "about", perspective, stega, }).catch(() => null), fetchSanitySettings({ perspective, stega, }).catch(() => null), ]); if (page?.blocks && page.blocks.length > 0) { return ( ); } return ; }