'use client'; import * as React from 'react'; import { useScroll, useTransform, m } from 'framer-motion'; import { Building2, Compass, Layers, ArrowDownToLine, Wrench, Factory, Zap, MapPin, CheckCircle2 } from 'lucide-react'; import { useTranslations } from 'next-intl'; const iconMap: Record = { Building2, Compass, Layers, ArrowDownToLine, Wrench, Factory, Zap, MapPin, CheckCircle2 }; interface Milestone { date: string; year: string; title: string; desc: string; iconName: string; } interface CompanyTimelineProps { badge?: string; title?: string; milestones?: Milestone[]; } export function CompanyTimeline({ badge, title, milestones }: CompanyTimelineProps) { const t = useTranslations('CompanyTimeline'); const finalBadge = badge || t('badge'); const finalTitle = title || t('title'); const finalMilestones = milestones || [ { date: '16.12.2015', year: '2015', title: t('milestones.2015.title'), desc: t('milestones.2015.desc'), iconName: 'Building2', }, { date: '04.02.2019', year: '2019', title: t('milestones.2019_ing.title'), desc: t('milestones.2019_ing.desc'), iconName: 'Compass', }, { date: '14.11.2019', year: '2019', title: t('milestones.2019_verw.title'), desc: t('milestones.2019_verw.desc'), iconName: 'Layers', }, { date: '21.10.2025', year: '2025', title: t('milestones.2025.title'), desc: t('milestones.2025.desc'), iconName: 'ArrowDownToLine', }, ]; const containerRef = React.useRef(null); const { scrollYProgress } = useScroll({ target: containerRef, offset: ["start center", "end center"] }); const lineHeight = useTransform(scrollYProgress, [0, 1], ["0%", "100%"]); return (
{/* Background Decor */}
{finalBadge}

{finalTitle}

{/* Central Line Background */}
{/* Animated Central Line */}
{finalMilestones.map((milestone, i) => { const isEven = i % 2 === 0; const Icon = iconMap[milestone.iconName] || Building2; return ( {/* Timeline Dot with Pulse */}
{/* Content Box Wrapper */}
{/* The Card */}
{/* Giant Typography Background Year */}
{milestone.year}
{/* Header Row */}
{milestone.date}

{milestone.title}

{milestone.desc}

); })}
); }