Files
o2o-infinith-demo/src/components/report/ui/SeverityBadge.tsx
T
Haewon KamandClaude Fable 5 ef4d8218e9 feat: AI Discovery AEO/GEO 채점 기준표 v1.0 + /discovery/:id 리포트 (뷰성형외과 44점)
- 채점 기준표: 6 카테고리 36 항목 100점, 항목별 근거등급/통제/채점방식/howToCheck
- 집계: 미검증 항목 분모 제외, llms.txt 항목 제외
- 뷰성형외과 실측 결과 + 핵심 발견 5 + 액션 7 + 하지 않을 것 5
- DiscoveryReportPage: INFINITH 디자인 토큰, 본문 +2pt, 판정 배지/우선순위 +4pt 볼드, keep-all
- SeverityBadge className prop 추가
- Badge.tsx 복원 (PricingPage import 누락으로 빌드 깨져 있던 것)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-28 10:26:29 +09:00

44 lines
1.2 KiB
TypeScript

type SeverityLevel = 'critical' | 'warning' | 'good' | 'excellent' | 'unknown';
interface SeverityBadgeProps {
severity: SeverityLevel;
label?: string;
/** 크기·굵기 오버라이드 (기본 text-xs font-medium) */
className?: string;
}
const config: Record<SeverityLevel, { className: string; defaultLabel: string }> = {
critical: {
className: 'bg-[#FFF0F0] text-[#7C3A4B] border-[#F5D5DC]',
defaultLabel: '심각',
},
warning: {
className: 'bg-[#FFF6ED] text-[#7C5C3A] border-[#F5E0C5]',
defaultLabel: '주의',
},
good: {
className: 'bg-[#F3F0FF] text-[#4A3A7C] border-[#D5CDF5]',
defaultLabel: '양호',
},
excellent: {
className: 'bg-[#EFF0FF] text-[#3A3F7C] border-[#C5CBF5]',
defaultLabel: '우수',
},
unknown: {
className: 'bg-slate-50 text-slate-700 border-slate-200',
defaultLabel: '미확인',
},
};
export function SeverityBadge({ severity, label, className: extra = '' }: SeverityBadgeProps) {
const { className, defaultLabel } = config[severity];
return (
<span
className={`inline-flex items-center rounded-full border ${extra || 'text-xs font-medium px-3 py-1'} ${className}`}
>
{label ?? defaultLabel}
</span>
);
}