"use client"; type AgendaItem = { order: string; time: string; title: string; description: string; }; type Props = { data: { id: string; eyebrow: string; title: string; description: string; items: AgendaItem[]; }; }; const renderFormattedText = (text: string) => { if (!text) return ""; const lines = text.split("\n"); return lines.map((line, lineIndex) => { // Split the line by markdown bold (**bold**) and italic (*italic*) const parts = line.split(/(\*\*.*?\*\*|\*.*?\*)/g); const renderedLine = parts.map((part, partIndex) => { if (part.startsWith("**") && part.endsWith("**")) { return ( {part.slice(2, -2)} ); } if (part.startsWith("*") && part.endsWith("*")) { return ( {part.slice(1, -1)} ); } return part; }); return ( {renderedLine} ); }); }; export default function AgendaSection({ data }: Props) { return (
{/* Section Header */}
{data.eyebrow}

{data.title}

{data.description}

{/* Timeline Container */}
{/* Central vertical line */}
{/* Timeline Items */}
{data.items.map((item, index) => { const isEven = index % 2 === 0; return (
{/* Timeline Dot (glowing on hover) */}
{/* Left/Right alternating grid layout */}
{isEven ? ( <> {/* Left: Card (Desktop) / Full content (Mobile) */}
{item.order} {/* Mobile-only time badge */}
{item.time}

{renderFormattedText(item.title)}

{item.description && (
{renderFormattedText(item.description)}
)}
{/* Right: Time badge (Desktop-only) */}
{item.time}
) : ( <> {/* Left: Time badge (Desktop-only) */}
{item.time}
{/* Right: Card (Desktop) / Full content (Mobile) */}
{item.order} {/* Mobile-only time badge */}
{item.time}

{renderFormattedText(item.title)}

{item.description && (
{renderFormattedText(item.description)}
)}
)}
); })}
); }