const ROLES = ['CTO', 'CFO', 'Investor Rep', 'Independent'] const KEY_MAP = { 'CTO': 'cto', 'CFO': 'cfo', 'Investor Rep': 'inv', 'Independent': 'ind' } // ASCII block bar function AsciiTrustBar({ pct }) { const total = 12 const filled = Math.round((pct / 100) * total) return ( {'█'.repeat(filled)}{'░'.repeat(total - filled)} ) } export default function TrustPanel({ trust, prevTrust }) { if (!trust) { return (
Board Trust
// awaiting first round...
) } return (
Board Trust
{ROLES.map((role) => { const val = trust[role] ?? 0.5 const prev = prevTrust?.[role] const delta = prev !== undefined ? val - prev : null const cls = KEY_MAP[role] const pct = Math.round(val * 100) return (
{role}
{pct}% {delta !== null && Math.abs(delta) > 0.001 ? ( 0 ? 'pos' : 'neg'}`}> {delta > 0 ? '▲' : '▼'} ) : ( )}
) })}
) }