import { ReactNode } from 'react';
import { useI18n, type Language } from '../i18n';
// Shell components ported from components/Shell.jsx — class names preserved
// so the paper/ink/oxblood Board Console look is identical.
export function TopBar(props: {
game?: { id: string; turn: number; max: number; recon_remaining: number } | null;
route: string;
onNav: (r: string) => void;
}) {
const { game, route, onNav } = props;
const { t, lang, setLang } = useI18n();
return (
{game && (
{t('shell.status.case')} {game.id.slice(0, 4)}…{game.id.slice(-4)}
{t('shell.status.turn')} {game.turn} / {game.max}
{t('shell.status.recon')} {game.recon_remaining} / 3
)}
);
}
function LangToggle({
lang, setLang, ariaLabel,
}: {
lang: Language;
setLang: (l: Language) => void;
ariaLabel: string;
}) {
return (
|
);
}
const PHASES: { n: string; key: 'briefing' | 'recon' | 'action' | 'deliberation' | 'adjudication' }[] = [
{ n: '01', key: 'briefing' },
{ n: '02', key: 'recon' },
{ n: '03', key: 'action' },
{ n: '04', key: 'deliberation' },
{ n: '05', key: 'adjudication' },
];
export function PhaseRail({ current }: { current: 'briefing' | 'recon' | 'action' | 'deliberation' | 'adjudication' }) {
const { t } = useI18n();
const order = ['briefing', 'recon', 'action', 'deliberation', 'adjudication'];
const idx = order.indexOf(current);
return (
{PHASES.map((p, i) => (
{p.n}
{t(`phaseRail.${p.key}` as const)}
))}
);
}
export function Dossier(props: {
tag?: string; title?: string; children?: ReactNode; footnote?: string[];
className?: string; fog?: boolean; inverse?: boolean;
}) {
const { tag, title, children, footnote, className = '', fog = false, inverse = false } = props;
const { t } = useI18n();
return (
{fog && {t('shell.dossier.fog')}}
{tag && {tag}}
{title && {title}
}
{children}
{footnote && (
{footnote.map((f, i) => {f})}
)}
);
}
export function Panel({ tag, title, children }: { tag?: string; title?: string; children: ReactNode }) {
return (
{tag && {tag}}
{title && {title}
}
{children}
);
}
export function Spinner() {
return ;
}