/** * PBL v2 — Task evaluation card. * * Rendered inside an assistant chat bubble (NOT a standalone full- * width card — task eval is "small judgement step" per PR 6 D1-B). * Appears after the learner submits something AND advance_micro_task * fires the task eval flow. * * Fields used: strengths[], improvements[], score? — none of * what_you_built / what_you_learned / stars (those belong to other * evaluation kinds). Score is OPTIONAL: if the LLM omitted it we * just render the prose lists; no fake "/100" appears. * * Visual scope: * - tight, fits inside a chat bubble (max-width ~80%) * - strengths on top (green-ish accent), improvements below * (amber accent for "可以更好" — keep it light, not negative) * - score chip, top-right, hidden when score is undefined * * Design choice: we do NOT show stars on task eval. Stars are for * milestone + final reflection moments. Mixing star icons here * would dilute the visual contract. */ 'use client'; import { ClipboardCheck, TrendingUp, Sparkles } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useI18n } from '@/lib/hooks/use-i18n'; import type { PBLEvaluation } from '@/lib/pbl/v2/types'; interface Props { evaluation: PBLEvaluation; className?: string; } export function TaskEvaluationCard({ evaluation, className }: Props) { const { t } = useI18n(); if (evaluation.kind !== 'task') return null; const strengths = evaluation.strengths ?? []; const improvements = evaluation.improvements ?? []; const score = typeof evaluation.score === 'number' ? evaluation.score : undefined; if (strengths.length === 0 && improvements.length === 0 && score === undefined) { return null; } return (