import { Container, Badge, Heading } 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 (
{/* Generic Hero Section to match standard pages */}
{standort.type === 'hq' ? (safeLocale === 'de' ? 'Hauptsitz' : 'Headquarters') : (safeLocale === 'de' ? 'Niederlassung' : 'Branch')} {standort.name}
{/* Main Content Area */} {/* Excerpt/Lead paragraph */}

{standort.description[safeLocale]}

{/* Main content in prose style */}
{standort.name}

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

    {standort.keyFeatures[safeLocale].map((feature, idx) => (
  • {feature}
  • ))}

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

{safeLocale === 'de' ? 'Adresse:' : 'Address:'}
{standort.address.street}
{standort.address.city}

{safeLocale === 'de' ? 'In Google Maps öffnen' : 'Open in Google Maps'}

{safeLocale === 'de' ? 'Telefon:' : 'Phone:'}
{standort.contact.phone}

Email:
{standort.contact.email}

{standort.gallery && standort.gallery.length > 0 && ( <>

Galerie

{standort.gallery.map((img, idx) => (
{`Gallery
))}
)}
{/* Support Section */}

{t('needHelp')}

{t('supportTeamAvailable')}

{t('contactUs')}
); }