MyKindlebox/mykindlebox/client/src/components/Badge.jsx

23 lines
592 B
JavaScript

import { STATUS_LABELS } from '../lib/format'
const STATUS_CLASSES = {
active: 'bg-accent text-surface',
for_sale: 'bg-accent-warm text-surface',
on_hold: 'bg-text-secondary text-surface',
sold: 'bg-border text-text-primary',
deceased: 'bg-danger text-surface',
other: 'bg-border text-text-primary',
}
function Badge({ status }) {
return (
<span
className={`inline-block rounded-full px-2.5 py-0.5 font-body text-xs font-medium ${STATUS_CLASSES[status] ?? STATUS_CLASSES.other}`}
>
{STATUS_LABELS[status] ?? status}
</span>
)
}
export default Badge