snp-collector/frontend/src/components/StatusBadge.tsx
HYOJIN 94e41909d3 Remove unused bypass/screening code, update frontend favicon and title
- Remove 75 orphaned files: bypass API (models, DTOs, repositories, base classes, SQL schema),
  screening (models, DTOs, repositories), and CodeGenerationResult DTO
- Replace favicon with navy version
- Rename app title from "S&P Data Platform" to "S&P Collector"
- Fix vite base path to match Spring Boot context-path (/snp-collector)
- Rewrite CLAUDE.md with accurate architecture documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:49:38 +09:00

41 lines
1.7 KiB
TypeScript

const STATUS_CONFIG: Record<string, { bg: string; text: string; label: string }> = {
COMPLETED: { bg: 'bg-emerald-100 text-emerald-700', text: '완료', label: '✓' },
FAILED: { bg: 'bg-red-100 text-red-700', text: '실패', label: '✕' },
STARTED: { bg: 'bg-blue-100 text-blue-700', text: '실행중', label: '↻' },
STARTING: { bg: 'bg-cyan-100 text-cyan-700', text: '시작중', label: '⏳' },
STOPPED: { bg: 'bg-amber-100 text-amber-700', text: '중지됨', label: '⏸' },
STOPPING: { bg: 'bg-orange-100 text-orange-700', text: '중지중', label: '⏸' },
ABANDONED: { bg: 'bg-gray-100 text-gray-700', text: '포기됨', label: '—' },
SCHEDULED: { bg: 'bg-violet-100 text-violet-700', text: '예정', label: '🕐' },
UNKNOWN: { bg: 'bg-gray-100 text-gray-500', text: '알수없음', label: '?' },
};
interface Props {
status: string;
className?: string;
}
export default function StatusBadge({ status, className = '' }: Props) {
const config = STATUS_CONFIG[status] || STATUS_CONFIG.UNKNOWN;
return (
<span className={`inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-semibold ${config.bg} ${className}`}>
<span>{config.label}</span>
{config.text}
</span>
);
}
// eslint-disable-next-line react-refresh/only-export-components
export function getStatusColor(status: string): string {
switch (status) {
case 'COMPLETED': return '#10b981';
case 'FAILED': return '#ef4444';
case 'STARTED': return '#3b82f6';
case 'STARTING': return '#06b6d4';
case 'STOPPED': return '#f59e0b';
case 'STOPPING': return '#f97316';
case 'SCHEDULED': return '#8b5cf6';
default: return '#6b7280';
}
}