website-builder-frontend/app/builder/[site]/product/[id]/page.tsx
S M Fahim Hossen dd9691acdc update
2025-09-25 10:53:13 +06:00

29 lines
737 B
TypeScript

"use client";
import { templates } from "@/lib/template";
import { getUserSites } from "@/lib/sites";
import { notFound } from "next/navigation";
interface ProductPageProps {
params: { site: string; id: string };
}
export default function ProductPage({ params }: ProductPageProps) {
if (typeof window === "undefined") return null;
const userSites = getUserSites();
const site = userSites.find((s) => s.slug === params.site);
if (!site) return notFound();
const Template = templates[site.template];
const Header = Template.Header;
const Footer = Template.Footer;
const Product = Template.pages.Product;
return (
<>
<Header />
<Product params={{ id: params.id }} />
<Footer />
</>
);
}