import { Card, CardContent, CardHeader, CardTitle } from "@pram/ui/components/card"; import { MaterialIcon } from "@/components/ui/MaterialIcon"; import { formatLabel } from "@/lib/format"; interface Weakness { type: "format" | "section" | "skill"; name: string; totalQuestions: number; accuracyPct: number; } interface WeaknessPanelProps { weaknesses: Weakness[] | undefined; recommendations: string[] | undefined; } function getTypeIcon(type: Weakness["type"]) { switch (type) { case "format": return "quiz"; case "section": return "folder"; case "skill": return "psychology"; } } function getTypeLabel(type: Weakness["type"]) { switch (type) { case "format": return "Format"; case "section": return "Section"; case "skill": return "Skill"; } } function getSeverityColor(pct: number) { if (pct < 40) return "text-[var(--pomegranate-600)]"; if (pct < 60) return "text-[var(--lemon-700)]"; return "text-[var(--matcha-600)]"; } export function WeaknessPanel({ weaknesses, recommendations }: WeaknessPanelProps) { const hasData = weaknesses && weaknesses.length > 0; return ( Area untuk Ditingkatkan {hasData ? ( <>
{weaknesses.map((w, _i) => (
{getTypeLabel(w.type)}
{formatLabel(w.name)}
{w.accuracyPct}%
{w.totalQuestions} soal
))}
{recommendations && recommendations.length > 0 && (

Rekomendasi

    {recommendations.map((rec, i) => (
  • {rec}
  • ))}
)} ) : (

Belum cukup data

Selesaikan lebih banyak latihan untuk melihat analisis kelemahan.

)}
); }