import type { JSX } from 'react';
import { Icon, type IconName } from '../ui/Icon';
import { problemLabel, type Problem } from './problem';
type Tone = 'bad' | 'warn' | 'moved';
const PROBLEM_LOOKS: Readonly<
Record< Problem, { icon: IconName; tone: Tone } >
> = {
broken: { icon: 'unlink', tone: 'bad' },
blocked: { icon: 'lock', tone: 'warn' },
moved: { icon: 'moved', tone: 'moved' },
};
export function StatusPill( { problem }: { problem: Problem } ): JSX.Element {
const { icon, tone } = PROBLEM_LOOKS[ problem ];
return (
{ problemLabel( problem ) }
);
}
export function StatusDot( { problem }: { problem: Problem } ): JSX.Element {
const { icon, tone } = PROBLEM_LOOKS[ problem ];
return (
);
}