"use client";
import React, { useEffect, useRef, useState } from "react";
import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import IndustryWorldMap from "./IndustryWorldMap";
if (typeof window !== "undefined") {
gsap.registerPlugin(ScrollTrigger);
}
/* ============================================================
EV Logistics section — the proven Elementor architecture:
Container (bbc6760)
├── Hero Image Container (7da6646) — parallax background banner
├── Floating Card Container (8b5d6e6)— number / title / subtitle
└── Content Section (.evnd) — eyebrow, title, body, stat bar
This component is content-driven via props. With no props it renders the
original homepage "EV Logistics" content verbatim (feature list + stat bar).
The MileTruth workflows (Performance, Innovation) reuse the EXACT same chrome
(banner → floating card → dark section) but render a COMPACT DASHBOARD in the
right column instead of the homepage feature list: a small KPI row over a set
of compact feature cards, sitting on the shared animated network backdrop.
The dashboard surfaces metrics fast, keeps descriptions short, cuts the
section height and reads far better on mobile than the old tall insight card.
============================================================ */
export interface EVFeature {
icon: React.ReactNode;
title: string;
desc: string;
}
export interface EVBadge {
value: string;
label: string;
}
export interface EVStat {
value: number;
decimals?: number;
suffix: string;
label: string;
/** Optional static text override — when set, renders this text instead of
* an animated CountUp (for non-numeric KPI concepts, e.g. "QUBO"). */
text?: string;
}
/** Accent theming for the dashboard column so it matches the scene on the left
* (Workflow 1 → cyan/teal · Workflow 2 → red/crimson). */
export interface EVCardsTheme {
/** Primary accent (metrics, icons, active rail, glow). */
accent: string;
/** Secondary accent (gradients, network lines, highlights). */
accent2: string;
/** Soft glow colour (rgba string). */
glow: string;
}
interface EVSectionProps {
/** Hero parallax banner background image. */
bannerImage?: string;
/** Floating card (8b5d6e6 → 3b61435). */
cardNumber?: string;
cardTitle?: string;
cardSubtitle?: string;
/** Content section (.evnd). */
eyebrow?: string;
titleLead?: string;
titleAccent?: string;
features?: EVFeature[];
image?: string;
imageAlt?: string;
badges?: EVBadge[];
stats?: EVStat[];
/** External spacing (used to keep the MileTruth workflow rhythm consistent). */
gapTop?: boolean;
gapBottom?: boolean;
ariaLabel?: string;
/** When provided, replaces the left hero
with custom media (e.g. a live
* Three.js scene). Badges still overlay on top. */
mediaSlot?: React.ReactNode;
/** When provided, the right column renders the compact dashboard (KPI row +
* compact feature cards on the animated network backdrop) instead of the
* static homepage feature list. The bottom stat bar is dropped in this mode
* to avoid repeating the metrics. */
metrics?: EVStat[];
/** Optional distinct copy for the bottom `.evnd__bar` strip in dashboard
* mode. Defaults to reusing `metrics` (WF1/WF2 behaviour) when omitted. */
barStats?: EVStat[];
/** Heading above the dashboard, e.g. "PERFORMANCE INSIGHT". */
cardsHeading?: string;
/** Accent theme for the dashboard column (defaults to the section red). */
cardsTheme?: EVCardsTheme;
/** Dashboard system label, top-right of the header row. Defaults to "AI ENGINE". */
sysLabel?: string;
/** Extra class appended to `.evnd__imgwrap`, for workflow-specific media
* sizing overrides (e.g. video object-fit) defined in the caller's own
* scoped