'use client'; import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import { MapPin, Factory, Zap, CheckCircle2, ArrowUpRight } from 'lucide-react'; import Image from 'next/image'; import { useRouter } from 'next/navigation'; import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder'; import { Location, defaultLocations, minorLocations } from '@/lib/map-data'; import { useLocale } from 'next-intl'; const allLocations = [...defaultLocations, ...minorLocations]; interface Stat { value: string; suffix?: string; label: string; } interface InteractiveGermanyMapProps { badge?: string; title?: React.ReactNode; description?: string; stats?: Stat[]; locations?: Location[]; isHero?: boolean; } export function InteractiveGermanyMap({ badge = 'Einsatzgebiete', title = <>Deutschlandweitfür Sie im Einsatz.>, description = 'Von unseren strategischen Standorten in Guben und Bülstedt steuern und realisieren wir komplexe Infrastrukturprojekte im gesamten Bundesgebiet.', stats = [ { value: '100', suffix: '%', label: 'Überregionale Reichweite' }, { value: '2', suffix: '+', label: 'Operative Standorte' }, ], locations = allLocations, isHero = false }: InteractiveGermanyMapProps) { const [activeLocation, setActiveLocation] = useState(null); const router = useRouter(); const locale = useLocale(); const hq = locations.find((l) => l.type === 'hq'); const branch = locations.find((l) => l.type === 'branch'); const projects = locations.filter((l) => l.type === 'project'); const minorNodes = locations.filter((l) => l.type === 'minor_node'); return ( {/* Animated Border Glow */} {!isHero && } {/* Background Effects */} {/* Content Left */} {badge} {isHero ? ( {title} ) : ( {title} )} {description} {/* Industrial Stats Grid */} {stats.map((stat, i) => ( {stat.value}{stat.suffix} {stat.label} ))} {/* Map Right */} {/* Map Container - Enforce strict aspect ratio matching the SVG (1024x1024) */} {/* Map SVG */} {/* Minor Location Markers (The 100+ generic projects) */} {locations.filter(l => l.type === 'minor_node').map((loc, idx) => ( setActiveLocation(loc)} onMouseLeave={() => setActiveLocation(null)} > ))} {/* Major & Reference Location Markers (HQ, Branch, Project) */} {locations.filter(l => l.type !== 'minor_node').map((loc, idx) => { const isHQ = loc.type === 'hq'; const isBranch = loc.type === 'branch'; const isActive = activeLocation?.id === loc.id; return ( setActiveLocation(loc)} onMouseLeave={() => setActiveLocation(null)} onClick={() => { if (loc.href) router.push(loc.href); }} > {/* Ping Animation for HQ / Branch */} {(isHQ || isBranch) && ( )} {/* Elegant Marker Dot */} {(isHQ || isBranch) && } ); })} {/* Global Tooltip */} {activeLocation && ( {activeLocation.featuredImage && ( )} {activeLocation.type === 'hq' ? 'Hauptsitz' : activeLocation.type === 'branch' ? 'Niederlassung' : activeLocation.type === 'minor_node' ? 'Projekt' : 'Referenz'} {activeLocation.name} {activeLocation.type !== 'minor_node' ? ( {activeLocation.description} ) : ( {activeLocation.description === 'wind' ? 'Errichtung Leitungstrassen & Netzanbindung für Windpark-Infrastruktur.' : activeLocation.description === 'pv' ? 'Bau von Mittelspannungstrassen zur Einspeisung der PV-Anlage.' : activeLocation.description === 'fiber' ? 'Komplexer FTTx Breitbandausbau inkl. LWL-Montage & Tiefbau.' : activeLocation.description === 'power' ? '110kV Hochspannungstrasse Erdkabelverlegung.' : activeLocation.description === 'battery' ? 'Infrastrukturausbau für BESS (Batteriespeicher).' : 'Komplexes Infrastrukturprojekt (Tiefbau & HDD).'} )} {(activeLocation.details || activeLocation.type === 'minor_node') && ( {activeLocation.type === 'minor_node' ? ( <> { activeLocation.description === 'wind' ? 'Netzanbindung Windpark' : activeLocation.description === 'pv' ? 'Einspeisung PV-Anlage' : activeLocation.description === 'fiber' ? 'FTTx Infrastruktur' : activeLocation.description === 'power' ? '110kV Trasse' : activeLocation.description === 'battery' ? 'BESS Anschluss' : 'Infrastrukturprojekt' } Tiefbau & Spülbohrung (HDD) > ) : ( activeLocation.details?.map((detail, i) => ( {detail} )) )} )} {activeLocation.href && ( {locale === 'en' ? 'Learn more' : 'Zum Projekt'} )} )} ); }
{description}