import { ArrowDown, ArrowRight, CornerLeftUp, RotateCcw } from 'lucide-react'
import type { ReactNode } from 'react'
import { boxState } from '@/lib/architecture'
import { SERIES } from '@/lib/chart'
import type { ArchBox, ArchDiagram, SystemId } from '@/lib/types'
import { cn } from '@/lib/utils'
/** The chapter's diagram, drawn by hand (owner, 9d redo: a few boxes, no crossing lines,
* one level of detail per diagram). `lit`: the boxes the step being read talks about,
* or null when no step is active (nothing dimmed). */
export function Diagram({ diagram, lit }: { diagram: ArchDiagram; lit: string[] | null }) {
if (diagram.kind === 'grid') return
const b = (id: string, className?: string) =>
switch (diagram.kind) {
case 'documents':
return (
{b('reply', 'mx-auto w-2/3')}
)
case 'measure':
return (
{b('tuning')}
{b('heldout')}
tunes the systems
{b('grading')}
{b('stats')}
{b('results')}
)
}
}
/** System A | B | C as aligned columns, the same steps on the same rows (small
* multiples): a step a system does not have is an empty dashed slot, so the
* differences show at a glance. A row lights up when the step being read names it. */
function EvidenceGrid({ diagram, lit }: { diagram: Extract; lit: string[] | null }) {
const systems: SystemId[] = ['a', 'b', 'c']
return (