// Section.jsx — OTIVM-IV
// Generic panel renderer. Receives a section definition and renders
// the appropriate sub-component based on the "type" field.
// Does not know what it is showing — delegates entirely to type.
//
// Section definition shape (from context-{id}.json):
// title — string, shown in panel header
// type — one of the section types below
// col — layout column assignment (read by Shell.jsx LayoutGrid)
// [data] — type-specific data array or object
//
// Section types:
// status-block — key/value pairs
// parameter-list — actor_parameters rows
// auctoritas — three-face auctoritas panel
// cost-table — cost items with amounts and sources
// drift-log — parameter_drift_log entries
// action-bar — action buttons
// route-list — trade route cards with cost breakdown
// text-block — narrative text, optionally collapsible
// map-canvas — TESSERA fog-of-war map placeholder
//
// The "col" prop is consumed by Shell.jsx LayoutGrid for column placement.
// Section.jsx itself ignores it.
import { useState } from 'react'
export default function Section({ title, type, col, ...props }) {
return (
{title}
)
}
function SectionBody({ type, ...props }) {
switch (type) {
case 'status-block': return
case 'parameter-list': return
case 'auctoritas': return
case 'cost-table': return
case 'drift-log': return
case 'action-bar': return
case 'route-list': return
case 'text-block': return
case 'map-canvas': return
default:
return
)
}
// ── Map canvas ────────────────────────────────────────────────────────────
// Placeholder — the real Map.jsx component is rendered by the MAP context screen.
// This type exists so Section.jsx can reference it; in production the MAP
// context screen passes the real Map.jsx output as a child instead.
function MapCanvas() {
return (
TESSERA H7 · roman_14bce
Map renders here — src/screens/Map.jsx
)
}
// ── Helpers ───────────────────────────────────────────────────────────────
function bandClass(val) {
if (!val) return 'otivm-band-low'
const v = val.toLowerCase()
if (v === 'high' || v === 'distinguished') return 'otivm-band-high'
if (v === 'medium' || v === 'neutral') return 'otivm-band-medium'
return 'otivm-band-low'
}