import type { Metadata } from "next";
import { notFound } from "next/navigation";
import IndustryDetail from "../industry-detail";
import { getIndustry, industries } from "@/lib/industries";

type Props = { params: Promise<{ slug: string }> };
export function generateStaticParams() { return industries.map(({ slug }) => ({ slug })); }
export async function generateMetadata({ params }: Props): Promise<Metadata> { const { slug } = await params; const industry = getIndustry(slug); if (!industry) return {}; return { title: industry.seo.title.ar, description: industry.seo.description.ar, alternates: { canonical: `/industries/${slug}`, languages: { "ar-SA": `/industries/${slug}`, en: `/en/industries/${slug}` } }, openGraph: { title: industry.seo.title.ar, description: industry.seo.description.ar, type: "website", locale: "ar_SA" } }; }
export default async function Page({ params }: Props) { const { slug } = await params; const industry = getIndustry(slug); if (!industry) notFound(); const data = { "@context": "https://schema.org", "@graph": [{ "@type": "Service", name: industry.seo.title.ar, description: industry.seo.description.ar, provider: { "@type": "Organization", name: "NEXORA AI" }, serviceType: industry.name.ar, inLanguage: "ar" }, { "@type": "BreadcrumbList", itemListElement: [{ "@type": "ListItem", position: 1, name: "القطاعات", item: "/industries" }, { "@type": "ListItem", position: 2, name: industry.name.ar, item: `/industries/${slug}` }] }] }; return <><script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} /><IndustryDetail industry={industry} lang="ar" /></>; }
