From b112913e8d251334ba980daf597fa5515602b01c Mon Sep 17 00:00:00 2001 From: Vula Builder Date: Fri, 31 Jul 2026 14:12:37 +0000 Subject: [PATCH] Deploy --- src/app/products/[productId]/page.tsx | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 src/app/products/[productId]/page.tsx diff --git a/src/app/products/[productId]/page.tsx b/src/app/products/[productId]/page.tsx new file mode 100644 index 0000000..dec1bef --- /dev/null +++ b/src/app/products/[productId]/page.tsx @@ -0,0 +1,55 @@ +import { Suspense } from 'react' +import Link from 'next/link' +import { ArrowLeft } from 'lucide-react' +import ProductDetailClient from '@/components/shop/ProductDetailClient' + +export const dynamic = 'force-dynamic' +export const revalidate = 0 + +const VULA_CMS_URL = process.env.VULA_CMS_URL || 'https://ide.vulai.co.za' +const VULA_PROJECT_ID = process.env.VULA_CMS_PROJECT_ID || '' + +async function getProduct(productId: string) { + try { + const res = await fetch( + `${VULA_CMS_URL}/api/store/${VULA_PROJECT_ID}/products/${productId}`, + { cache: 'no-store', signal: AbortSignal.timeout(8000) } + ) + if (!res.ok) return null + const data = await res.json() + return data.product ?? data ?? null + } catch { + return null + } +} + +interface PageProps { params: { productId: string } } + +export default async function ProductDetailPage({ params }: PageProps) { + const product = await getProduct(params.productId) + return ( +
+
+ + +
+
+ }> + +
+
+
+ ) +}