import type { ReactNode } from 'react'
import { num } from '../lib/format'
export function Panel({
children,
className = '',
title,
hint,
}: {
children: ReactNode
className?: string
title?: string
hint?: string
}) {
return (
{title && (
)}
{children}
)
}
export function Bar({ value, color }: { value: number; color: string }) {
return (
)
}
export function Badge({
children,
color,
subtle = false,
}: {
children: ReactNode
color: string
subtle?: boolean
}) {
return (
{children}
)
}
export function Dot({ color }: { color: string }) {
return
}
export function Stat({
label,
value,
accent,
icon,
}: {
label: string
value: ReactNode
accent?: string
icon?: ReactNode
}) {
return (
{label}
{icon && {icon}}
{value}
)
}
// CheckRow renders a met (✓) / unmet (⚠) requirement line.
export function CheckRow({ ok, label }: { ok: boolean; label: string }) {
return (
{ok ? '✓' : '!'}
{label}
)
}
export function ScoreRow({
name,
weight,
score,
color,
}: {
name: string
weight: string
score: string
color: string
}) {
return (
{name}
{Math.round(Number(weight) * 100)}%
{num(score).toFixed(0)}%
)
}