diff --git a/components/blocks/HeroVideo.tsx b/components/blocks/HeroVideo.tsx index a25cabe93..01d35c41b 100644 --- a/components/blocks/HeroVideo.tsx +++ b/components/blocks/HeroVideo.tsx @@ -37,19 +37,10 @@ export function HeroVideo(props: HeroVideoProps) { const ctaLabel = props.ctaLabel || props.linkText || data?.ctaLabel || 'Unternehmen entdecken'; const ctaHref = props.ctaHref || props.linkHref || data?.ctaHref || '#unternehmen'; - let currentLocale = 'de'; - try { - // We can't unconditionally call hooks if they might fail outside context, but HeroVideo is usually in context. - // However, to be safe and avoid adding new imports, we can use window.location or default to 'de' if not available. - if (typeof window !== 'undefined') { - currentLocale = window.location.pathname.startsWith('/en') ? 'en' : 'de'; - } - } catch (e) { - // Fallback to default locale if window/location access fails - } + const currentLocale = pathname?.startsWith('/en') ? 'en' : 'de'; const secondaryCtaLabel = props.secondaryCtaLabel || data?.secondaryCtaLabel || (currentLocale === 'de' ? 'Projekt anfragen' : 'Inquire Project'); - const secondaryCtaHref = props.secondaryCtaHref || data?.secondaryCtaHref || `/${currentLocale}/${currentLocale === 'de' ? 'contact' : 'contact'}`; + const secondaryCtaHref = props.secondaryCtaHref || data?.secondaryCtaHref || `/${currentLocale}/contact`; return (
@@ -98,7 +89,7 @@ export function HeroVideo(props: HeroVideoProps) { >

KABELTIEFBAU').replace(/\\n|\n/g, '
') }} + dangerouslySetInnerHTML={{ __html: title.replace(/KABELTIEFBAU|Kabeltiefbau/g, 'Kabeltiefbau').replace(/KABELNETZBAU|Kabelnetzbau/g, 'Kabelnetzbau').replace(/\\n|\n/g, '
') }} />

diff --git a/components/blocks/InteractiveGermanyMap.tsx b/components/blocks/InteractiveGermanyMap.tsx index e8f772238..4b926b842 100644 --- a/components/blocks/InteractiveGermanyMap.tsx +++ b/components/blocks/InteractiveGermanyMap.tsx @@ -52,10 +52,16 @@ export function InteractiveGermanyMap({ const finalTitle = title || (locale === 'en' ? <>Nationwide
in operation for you. : <>Deutschlandweit
für Sie im Einsatz.); const finalDescription = description || (locale === 'en' ? 'From our strategic locations in Guben, Kirchheilingen and Bülstedt, we control and implement complex infrastructure projects nationwide.' : 'Von unseren strategischen Standorten in Guben, Kirchheilingen und Bülstedt steuern und realisieren wir komplexe Infrastrukturprojekte im gesamten Bundesgebiet.'); - 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'); + const finalLocations = React.useMemo(() => { + // Ensure the 3 standorte are always included, without duplicating if already present by ID + const base = [...locations]; + standorteLocations.forEach(sl => { + if (!base.some(l => l.id === sl.id)) { + base.push(sl as Location); + } + }); + return base; + }, [locations]); return (

@@ -138,7 +144,7 @@ export function InteractiveGermanyMap({
{/* Minor Location Markers (The 100+ generic projects) */} - {locations.filter(l => l.type === 'minor_node').map((loc, idx) => ( + {finalLocations.filter(l => l.type === 'minor_node' || l.type === 'project').map((loc, idx) => (
))} - {/* Major & Reference Location Markers (HQ, Branch, Project) */} - {locations.filter(l => l.type !== 'minor_node').map((loc, idx) => { + {/* Major Location Markers (HQ, Branch) */} + {finalLocations.filter(l => l.type === 'hq' || l.type === 'branch').map((loc, idx) => { const isHQ = loc.type === 'hq'; const isBranch = loc.type === 'branch'; const isActive = activeLocation?.id === loc.id; @@ -273,7 +279,7 @@ export function InteractiveGermanyMap({ )} - {activeLocation.href && ( + {activeLocation.href && (activeLocation.type === 'hq' || activeLocation.type === 'branch') && (
{t('learnMore')} diff --git a/components/blocks/ScaleOfImpact.tsx b/components/blocks/ScaleOfImpact.tsx index d8a900eb2..ce3ceae6c 100644 --- a/components/blocks/ScaleOfImpact.tsx +++ b/components/blocks/ScaleOfImpact.tsx @@ -84,19 +84,19 @@ export function ScaleOfImpact() { {/* Static Data Grid (No jumping text) */}
-
200+
+
200 +
{locale === 'en' ? 'Projects' : 'Projekte'}
-
974km
+
974 km
{locale === 'en' ? 'Cable Laying' : 'Kabelverlegung'}
-
300km
+
300 km
{locale === 'en' ? 'Open Trenching' : 'Offener Tiefbau'}
-
160km
+
160 km
{locale === 'en' ? 'HDD Drilling' : 'Spülbohrung'}
diff --git a/content/de/home.mdx b/content/de/home.mdx index c572a98f6..2f3f76aca 100644 --- a/content/de/home.mdx +++ b/content/de/home.mdx @@ -5,7 +5,7 @@ description: "Die E-TIB GmbH ist Ihr zuverlässiger Partner für komplexe Kabelt