|
| 1 | +import { CheckCircle2, Download, Package, FileCode, ShieldCheck } from 'lucide-react'; |
| 2 | + |
| 3 | +const phaseConfig: Record<string, { icon: typeof Download; label: string }> = { |
| 4 | + opencore: { icon: Download, label: 'Downloading OpenCore' }, |
| 5 | + kexts: { icon: Package, label: 'Downloading Kexts' }, |
| 6 | + config: { icon: FileCode, label: 'Generating Config' }, |
| 7 | + validate: { icon: ShieldCheck, label: 'Validating' }, |
| 8 | +}; |
| 9 | + |
| 10 | +interface BuildPhaseRowProps { |
| 11 | + phase: string; |
| 12 | + active: boolean; |
| 13 | + completed: boolean; |
| 14 | + message?: string; |
| 15 | +} |
| 16 | + |
| 17 | +export function BuildPhaseRow({ phase, active, completed, message }: BuildPhaseRowProps) { |
| 18 | + const meta = phaseConfig[phase]; |
| 19 | + if (!meta) return null; |
| 20 | + |
| 21 | + return ( |
| 22 | + <div className="flex items-center gap-3 px-4 py-2.5"> |
| 23 | + <div className="shrink-0"> |
| 24 | + {completed ? ( |
| 25 | + <CheckCircle2 size={15} className="text-[--color-green-5]" /> |
| 26 | + ) : active ? ( |
| 27 | + <span className="relative flex size-[15px] items-center justify-center"> |
| 28 | + <span className="absolute size-full rounded-full bg-[--accent] opacity-30 animate-ping" /> |
| 29 | + <span className="relative size-2 rounded-full bg-[--accent]" /> |
| 30 | + </span> |
| 31 | + ) : ( |
| 32 | + <span className="block size-[15px] rounded-full border border-[--border] bg-transparent" /> |
| 33 | + )} |
| 34 | + </div> |
| 35 | + <div className="flex-1 min-w-0"> |
| 36 | + <p |
| 37 | + className={`text-[0.8125rem] leading-snug ${ |
| 38 | + active |
| 39 | + ? 'text-[--text-primary] font-medium' |
| 40 | + : completed |
| 41 | + ? 'text-[--text-secondary]' |
| 42 | + : 'text-[--text-tertiary]' |
| 43 | + }`} |
| 44 | + > |
| 45 | + {meta.label} |
| 46 | + </p> |
| 47 | + {active && message && ( |
| 48 | + <p className="text-[0.6875rem] text-[--text-tertiary] mt-0.5 truncate">{message}</p> |
| 49 | + )} |
| 50 | + </div> |
| 51 | + </div> |
| 52 | + ); |
| 53 | +} |
0 commit comments