18 lines
443 B
TypeScript
18 lines
443 B
TypeScript
import styles from './StatusBadge.module.css';
|
|
|
|
export type Status = 'healthy' | 'warning' | 'critical' | 'unknown';
|
|
|
|
interface StatusBadgeProps {
|
|
status: Status;
|
|
label?: string;
|
|
}
|
|
|
|
export function StatusBadge({ status, label }: StatusBadgeProps) {
|
|
return (
|
|
<span className={styles.badge}>
|
|
<span className={`${styles.dot} ${styles[status]}`} />
|
|
{label && <span className={styles.label}>{label}</span>}
|
|
</span>
|
|
);
|
|
}
|