workspace-ui-kit/components/primitives/ScoreLabel.tsx
snc777 f6a781c47e initial commit
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-09 14:24:17 +09:00

35 lines
1.3 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* ScoreLabel — 候補者の代表平均スコアを「★ 4.3」形式で表示する読み取り専用ラベル。
*
* Pane 3 ヘッダー帯(閉時)で名前の隣にサブテキストとして配置し、
* 採用担当者が「この候補者は採る価値があるか」を 5 秒で判断する材料となる。
*
* 計算は `getCandidateAverageScore()` の派生値(最新 done scorecard の axisScores 平均)。
* null未評価のときは `★ —` を表示する。
*
* クリック動作は持たないADR-0015 §19 大決定 L: スコアは読み取り専用ラベル)。
* 4 軸の内訳が見たければ、選考フローカードから Pane 4 モード 2 へジャンプする。
*/
import { Star } from "lucide-react";
export type ScoreLabelProps = {
/** 平均スコアnull = 未評価) */
value: number | null;
};
export function ScoreLabel({ value }: ScoreLabelProps) {
const displayValue = value !== null ? value.toFixed(1) : "—";
return (
<span
className="inline-flex items-center gap-1 text-sm text-muted-foreground tabular-nums"
aria-label={
value !== null ? `評価平均 ${displayValue}` : "評価平均 未評価"
}
>
<Star className="size-3 fill-primary text-primary" aria-hidden="true" />
{displayValue}
</span>
);
}