"use client"; import * as React from "react"; import { motion } from "framer-motion"; import { Reveal } from "@/components/reveal"; export type RoadmapStatus = "done" | "in-progress" | "next" | "planned"; export type RoadmapItem = { title: string; description?: string; status: RoadmapStatus; date?: string; bullets?: string[]; }; function statusLabel(status: RoadmapStatus) { switch (status) { case "done": return "Shipped"; case "in-progress": return "In progress"; case "next": return "Next up"; case "planned": return "Planned"; } } function statusWeight(status: RoadmapStatus) { // Progress-style weighting: // done = 1.0, in-progress = 0.6, next = 0.25, planned = 0.0 switch (status) { case "done": return 1.0; case "in-progress": return 0.6; case "next": return 0.25; case "planned": return 0.0; } } function statusDotClass(status: RoadmapStatus) { // Keep neutral, glassy, specular (no hard colors). // Use opacity + ring + subtle fill to communicate state. switch (status) { case "done": return "bg-white/80 ring-1 ring-white/40 shadow-sm"; case "in-progress": return "bg-white/60 ring-1 ring-white/30 shadow-sm"; case "next": return "bg-white/35 ring-1 ring-white/25"; case "planned": return "bg-white/20 ring-1 ring-white/20"; } } function statusPillClass(status: RoadmapStatus) { switch (status) { case "done": return "glass px-2.5 py-1 text-[11px] tracking-wide text-black/70"; case "in-progress": return "glass px-2.5 py-1 text-[11px] tracking-wide text-black/70"; case "next": return "glass px-2.5 py-1 text-[11px] tracking-wide text-black/60"; case "planned": return "glass px-2.5 py-1 text-[11px] tracking-wide text-black/55"; } } export function RoadmapTimeline({ title = "Roadmap", subtitle = "Build plan and delivery cadence for this system.", items, }: { title?: string; subtitle?: string; items: RoadmapItem[]; }) { const total = Math.max(items.length, 1); const progress = Math.min( 1, Math.max( 0, items.reduce((acc, it) => acc + statusWeight(it.status), 0) / total ) ) || 0; const progressPct = Math.round(progress * 100); return (

{title}

{subtitle}

Progress
{progressPct}%
Planned → Shipped {progressPct}%
{/* Timeline spine */}
{items.map((it, idx) => (

{it.title}

{statusLabel(it.status)}
{(it.date || it.description) && (
{it.date ? ( {it.date} ) : null} {it.date && it.description ? ( ) : null} {it.description ? {it.description} : null}
)}
{String(idx + 1).padStart(2, "0")}/{String(items.length).padStart(2, "0")}
{it.bullets?.length ? (
    {it.bullets.map((b, bi) => (
  • {b}
  • ))}
) : null}
))}
{/* Specular highlight */}
); }