import type { Metadata } from "next";
import { notFound } from "next/navigation";
import IndustryDetail from "../../../industries/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.en, description: industry.seo.description.en, alternates: { canonical: `/en/industries/${slug}`, languages: { "ar-SA": `/industries/${slug}`, en: `/en/industries/${slug}` } }, openGraph: { title: industry.seo.title.en, description: industry.seo.description.en, type: "website", locale: "en_US" } }; }
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.en, description: industry.seo.description.en, provider: { "@type": "Organization", name: "NEXORA AI" }, serviceType: industry.name.en, inLanguage: "en" }, { "@type": "BreadcrumbList", itemListElement: [{ "@type": "ListItem", position: 1, name: "Industries", item: "/en/industries" }, { "@type": "ListItem", position: 2, name: industry.name.en, item: `/en/industries/${slug}` }] }] }; return <><script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }} /><IndustryDetail industry={industry} lang="en" /></>; }
