import * as React from 'react' export interface QualityScore { score: number grade: 'A' | 'B' | 'C' | 'D' | 'F' } export interface QualityBadgeProps { quality: QualityScore showScore?: boolean } const GRADE_STYLES: Record = { A: 'bg-green-100 text-green-800 border-green-200', B: 'bg-blue-100 text-blue-800 border-blue-200', C: 'bg-yellow-100 text-yellow-800 border-yellow-200', D: 'bg-orange-100 text-orange-800 border-orange-200', F: 'bg-red-100 text-red-800 border-red-200', } const GRADE_LABELS: Record = { A: 'Excellent', B: 'Good', C: 'Fair', D: 'Poor', F: 'Incomplete', } export function QualityBadge({ quality, showScore = false }: QualityBadgeProps) { const { grade, score } = quality const styleClass = GRADE_STYLES[grade] const label = GRADE_LABELS[grade] return ( {grade} {showScore && ({score})} ) }