"use client"; import { ScoreBar } from "@/components/ScoreBar"; import { AccessibilityBadge } from "@/components/AccessibilityBadge"; import { VisaSponsorshipNote } from "@/components/VisaSponsorshipNote"; import { isScoreResult, type ScoreResult } from "@/lib/types"; function verdictStyle(verdict: ScoreResult["verdict"]): { color: string; bg: string } { if (verdict === "Strong Match") return { color: "#1D9E75", bg: "#E1F5EE" }; if (verdict === "Possible") return { color: "#BA7517", bg: "#FAEEDA" }; return { color: "#E24B4A", bg: "#FCEBEB" }; } function safeBarScore(n: unknown): number { return typeof n === "number" && Number.isFinite(n) ? n : 0; } /** Two-stage session + profile bars (above standard dimensions). */ export function TwoStageSessionProfileScoreRows({ result }: { result: ScoreResult }) { if (!result.session_fit || !result.profile_fit) return null; return ( <>
Search fit
Profile fit
); } export function BatchStyleScoreBreakdown({ result }: { result: ScoreResult }) { if (!isScoreResult(result)) { return (

Stored score is incomplete.

); } const verdict = result.verdict === "Strong Match" || result.verdict === "Possible" || result.verdict === "Skip" ? result.verdict : "Skip"; const { color, bg } = verdictStyle(verdict); const dims = [ { label: "Role & skill fit", key: "role_fit" as const }, { label: "Global remote", key: "global_remote" as const }, { label: "Async culture", key: "culture_async" as const }, { label: "Contractor friendly", key: "contractor_friendly" as const }, ]; return (
{verdict} {typeof result.verdict_reason === "string" ? result.verdict_reason : ""}
{dims.map((d) => { const dim = result[d.key]; return (
{d.label}
); })} {result.semantic_score && typeof result.semantic_score === "object" && result.semantic_score !== null ? (
Semantic match
) : null}
); }