import { AlertCircle } from 'lucide-react'; import type { ColorSubstitution } from '../api/client'; import { getColorName } from '../utils/colors'; /** * One line per slot sent with a spool of another colour than the file asks * for (#3279). Shared by the queue row and the compact history row, so a job * says the same thing while it prints and once it is done. */ export function ColorSubstitutionNotes({ substitutions, t, className, }: { substitutions: ColorSubstitution[] | null | undefined; t: (key: string, options?: Record) => string; className: string; }) { if (!substitutions || substitutions.length === 0) return null; const label = (hex: string, type: string) => `${getColorName(hex, type)} (${hex})`; return ( <> {substitutions.map((sub) => (

{t('queue.colorSubstitution.rowBadge', { slot: sub.slot_id, got: label(sub.got, sub.type), wanted: label(sub.wanted, sub.type), })}

))} ); }