/** * WorthDoing.ai * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * File: src/components/wd/ScorePanel.tsx * Description: Dimension score bars — thin single-hue magnitude bars with per-dimension confidence, labels in ink. */ import { cn } from "@/lib/utils"; export type UiScore = { dimension: string; score: number; confidence: number; reasoning: string; }; const DIMENSION_LABELS: Record = { demand: "Demand", neglectedness: "Neglectedness", feasibility: "Feasibility", why_now: "Why now", impact: "Impact", competition: "Competitive position", risk: "Risk manageability", }; export function ScorePanel({ scores }: { scores: UiScore[] }) { const ordered = [...scores].sort((a, b) => b.score - a.score); return (
{ordered.map((s) => (
{DIMENSION_LABELS[s.dimension] ?? s.dimension} {Math.round(s.score)} = 0.7 ? "text-verdict" : s.confidence >= 0.45 ? "text-signal" : "text-rust", )} > {Math.round(s.confidence * 100)}% conf

{s.reasoning}

))}
); }