import { notFound } from 'next/navigation'; import { Container, Badge, Heading } from '@/components/ui'; import { setRequestLocale } from 'next-intl/server'; import { Metadata } from 'next'; import { getReferenceBySlug, getAllReferences } from '@/lib/references'; import { MDXRemote } from 'next-mdx-remote/rsc'; import { SITE_URL } from '@/lib/schema'; import TrackedLink from '@/components/analytics/TrackedLink'; import { getButtonClasses, ButtonOverlay } from '@/components/ui/Button'; import { MapPin, Calendar, Briefcase, ChevronLeft } from 'lucide-react'; import Image from 'next/image'; interface PageProps { params: Promise<{ locale: string; slug: string; }>; } export async function generateMetadata({ params }: PageProps): Promise { const { locale, slug } = await params; if (locale !== 'de' && locale !== 'en') return {}; const reference = await getReferenceBySlug(slug, locale); if (!reference) return {}; return { title: `${reference.frontmatter.title} | Referenzen | E-TIB Gruppe`, description: `Details zum Projekt ${reference.frontmatter.title} in ${reference.frontmatter.location}.`, alternates: { canonical: `${SITE_URL}/${locale}/referenzen/${slug}`, }, openGraph: { title: `${reference.frontmatter.title} | E-TIB`, description: `Details zum Projekt ${reference.frontmatter.title} in ${reference.frontmatter.location}.`, url: `${SITE_URL}/${locale}/referenzen/${slug}`, }, }; } export async function generateStaticParams(props: any) { const params = await props.params; const locale = params?.locale || 'de'; // fallback to 'de' if undefined const references = await getAllReferences(locale); return references.map((ref) => ({ slug: ref.slug, locale })); } export default async function ReferenceDetail(props: { params: Promise<{ locale: string; slug: string }> }) { const { locale, slug } = await props.params; if (locale !== 'de' && locale !== 'en') { notFound(); } setRequestLocale(locale); const reference = await getReferenceBySlug(slug, locale); if (!reference) { notFound(); } // MDX components mapping for industrial typography const mdxComponents = { Heading, h1: (props: any) => , // Hidden because Hero handles H1 h2: (props: any) => , h3: (props: any) => , h4: (props: any) => , p: (props: any) =>

, ul: (props: any) =>