import type { Metadata } from "next";
import { TemplateGalleryClient } from "@/components/TemplateGalleryClient";
import { DEMO_RESTAURANT, DEMO_CATEGORIES } from "@/lib/demo-data";

export const metadata: Metadata = {
  title: "Menü Şablonları & Canlı Demo | Menulio",
  description: "Menulio'nun 5 farklı lüks restoran şablonunu cihaz simülatöründe canlı olarak deneyimleyin.",
};

type PageProps = {
  searchParams?: Promise<{ theme?: string }>;
};

export default async function TemplatesPage({ searchParams }: PageProps) {
  const resolvedSearchParams = searchParams ? await searchParams : {};
  const currentTheme = resolvedSearchParams.theme || "elegant";

  return (
    <TemplateGalleryClient
      restaurant={DEMO_RESTAURANT}
      categories={DEMO_CATEGORIES}
      initialThemeKey={currentTheme}
    />
  );
}
