forked from fahrPool/fahrPool
26 lines
789 B
TypeScript
26 lines
789 B
TypeScript
import type { AuftragStatus } from "@/lib/auftraege/queries";
|
|
|
|
const STATUS_LABELS: Record<AuftragStatus, string> = {
|
|
offen: "Offen",
|
|
zugewiesen: "Zugewiesen",
|
|
unterwegs: "Unterwegs",
|
|
abgeschlossen: "Abgeschlossen",
|
|
storniert: "Storniert",
|
|
};
|
|
|
|
const STATUS_CLASSES: Record<AuftragStatus, string> = {
|
|
offen: "bg-gray-100 text-status-neutral",
|
|
zugewiesen: "bg-blue-50 text-performance-blue",
|
|
unterwegs: "bg-amber-50 text-status-warning",
|
|
abgeschlossen: "bg-green-50 text-status-success",
|
|
storniert: "bg-red-50 text-status-danger",
|
|
};
|
|
|
|
export function StatusBadge({ status }: { status: AuftragStatus }) {
|
|
return (
|
|
<span className={`inline-block rounded-full px-3 py-1 text-sm font-medium ${STATUS_CLASSES[status]}`}>
|
|
{STATUS_LABELS[status]}
|
|
</span>
|
|
);
|
|
}
|