"use client"; import * as React from "react"; import { motion } from "framer-motion"; import { Button } from "@/src/components/Button"; import { DecodeText } from "@/src/components/bits/DecodeText"; import { PathScene } from "@/src/components/illustrations/PathScenes"; import { SERVICE_PATHS, type ServicePath } from "@/src/content/paths"; const MONO = "font-mono text-[11px] uppercase tracking-[0.2em] text-slate-500"; const STEP_MS = 4800; /** * PathStory: the four steps of one path, each with a drawing that explains it. * The steps advance on their own until the visitor picks one. */ const PathStory: React.FC<{ path: ServicePath; active: boolean }> = ({ path, active, }) => { const [step, setStep] = React.useState(0); const [auto, setAuto] = React.useState(true); const ref = React.useRef(null); const [inView, setInView] = React.useState(false); React.useEffect(() => { const node = ref.current; if (!node) return; const observer = new IntersectionObserver( ([entry]) => setInView(entry?.isIntersecting ?? false), { threshold: 0.35 }, ); observer.observe(node); return () => observer.disconnect(); }, []); React.useEffect(() => { if (!active || !auto || !inView) return; if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; const timer = window.setInterval( () => setStep((current) => (current + 1) % path.steps.length), STEP_MS, ); return () => window.clearInterval(timer); }, [active, auto, inView, path.steps.length]); const current = path.steps[step]; return (
{step + 1} / {path.steps.length}
    {path.steps.map((item, index) => { const selected = index === step; return (
  1. ); })}
); }; /** * PathPicker: the visitor says what they need and gets the answer for exactly that: * what they get, how it runs, what it costs, what to do next. * All three panels stay in the DOM so the content is readable without JavaScript. */ export const PathPicker: React.FC = () => { const [activeId, setActiveId] = React.useState(SERVICE_PATHS[0]?.id ?? ""); return (
{SERVICE_PATHS.map((path, index) => { const selected = path.id === activeId; return ( ); })}
{SERVICE_PATHS.map((path) => { const selected = path.id === activeId; return ( ); })}
); };