import { Container } from '@/components/ui'; import { getTranslations, setRequestLocale } from 'next-intl/server'; import { Metadata } from 'next'; import { notFound } from 'next/navigation'; import { standorteData, getStandortById } from '@/lib/standorte-data'; import { SITE_URL } from '@/lib/schema'; import Image from 'next/image'; import { MapPin, Phone, Mail, Navigation, CheckCircle2, ArrowUpRight } from 'lucide-react'; import { getButtonClasses, ButtonOverlay } from '@/components/ui/Button'; import TrackedLink from '@/components/analytics/TrackedLink'; import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder'; interface PageProps { params: Promise<{ locale: string; slug: string; }>; } export async function generateStaticParams() { const locales = ['de', 'en']; const params: { locale: string; slug: string }[] = []; for (const locale of locales) { for (const standort of standorteData) { params.push({ locale, slug: standort.id }); } } return params; } export async function generateMetadata({ params }: PageProps): Promise { const { locale, slug } = await params; if (locale !== 'de' && locale !== 'en') return {}; const standort = getStandortById(slug); if (!standort) return {}; return { title: `${standort.name} | E-TIB Gruppe`, description: standort.description[locale], alternates: { canonical: `${SITE_URL}/${locale}/standorte/${slug}`, languages: { de: `${SITE_URL}/de/standorte/${slug}`, en: `${SITE_URL}/en/standorte/${slug}`, 'x-default': `${SITE_URL}/en/standorte/${slug}`, }, }, }; } export default async function StandortDetail(props: { params: Promise<{ locale: string; slug: string }> }) { const { locale, slug } = await props.params; const safeLocale = locale === 'de' ? 'de' : 'en'; setRequestLocale(safeLocale); const t = await getTranslations('StandardPage'); const standort = getStandortById(slug); if (!standort) { notFound(); } return (
{/* Header Section */}
{standort.type === 'hq' ? (safeLocale === 'de' ? 'Hauptsitz' : 'Headquarters') : (safeLocale === 'de' ? 'Niederlassung' : 'Branch')}

{standort.name}

{standort.description[safeLocale]}

{/* Main Content (Images & Description) */}
{/* Featured Image */}
{standort.name}
{/* Key Features */}

{safeLocale === 'de' ? 'Unsere Leistungen vor Ort' : 'Our Local Services'}

    {standort.keyFeatures[safeLocale].map((feature, idx) => (
  • {feature}
  • ))}
{/* Gallery (if any) */} {standort.gallery && standort.gallery.length > 0 && (
{standort.gallery.map((img, idx) => (
{`Gallery
))}
)}
{/* Sidebar (Contact & Address) */}
{/* Contact Card */}

{safeLocale === 'de' ? 'Kontakt & Anfahrt' : 'Contact & Directions'}

{safeLocale === 'de' ? 'Adresse' : 'Address'}
{standort.address.street}
{standort.address.city}
{(() => { const baseUrl = 'https://maps.google.com/'; const mapsUrl = `${baseUrl}?q=${encodeURIComponent(`${standort.address.street}, ${standort.address.city}`)}`; return ( {safeLocale === 'de' ? 'In Google Maps öffnen' : 'Open in Google Maps'} ); })()}
{safeLocale === 'de' ? 'Telefon' : 'Phone'}
{standort.contact.phone}
); }