import WorkshopDetailPage from "../page";

// SEO metadata is generated by the parent [id] route (it reads only `id`), so
// the /workshops/{id}/{slug} URL gets the same per-workshop title/description.
export { generateMetadata } from "../page";

export const dynamic = "force-dynamic";

interface Props {
  params: Promise<{ id: string; slug: string }>;
  searchParams: Promise<Record<string, string | string[]>>;
}

/**
 * SEO route: /workshops/{id}/{slug}
 *
 * The {slug} is cosmetic (for SEO). We fetch by {id} exactly as before, so this
 * reuses the existing detail page unchanged. /workshops/{id} (no slug) still
 * works via the parent [id]/page.tsx, so old links never break.
 */
export default async function WorkshopDetailWithSlugPage({
  params,
  searchParams,
}: Props) {
  const { id } = await params;
  return WorkshopDetailPage({
    params: Promise.resolve({ id }),
    searchParams,
  });
}
