feat: establish reservation portal foundation
This commit is contained in:
47
resources/js/components/reservation-status.tsx
Normal file
47
resources/js/components/reservation-status.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
const statuses: Record<string, { label: string; className: string }> = {
|
||||
draft: { label: 'Rascunho', className: 'bg-slate-100 text-slate-700' },
|
||||
pending_approval: {
|
||||
label: 'Aguarda aprovação',
|
||||
className: 'bg-amber-100 text-amber-800',
|
||||
},
|
||||
awaiting_information: {
|
||||
label: 'Aguarda informação',
|
||||
className: 'bg-orange-100 text-orange-800',
|
||||
},
|
||||
approved: {
|
||||
label: 'Aprovada',
|
||||
className: 'bg-emerald-100 text-emerald-800',
|
||||
},
|
||||
ready: {
|
||||
label: 'Pronta para entrega',
|
||||
className: 'bg-sky-100 text-sky-800',
|
||||
},
|
||||
delivered: { label: 'Entregue', className: 'bg-blue-100 text-blue-800' },
|
||||
in_use: {
|
||||
label: 'Em utilização',
|
||||
className: 'bg-indigo-100 text-indigo-800',
|
||||
},
|
||||
returned: { label: 'Devolvida', className: 'bg-teal-100 text-teal-800' },
|
||||
completed: { label: 'Concluída', className: 'bg-slate-100 text-slate-700' },
|
||||
rejected: { label: 'Rejeitada', className: 'bg-rose-100 text-rose-800' },
|
||||
cancelled: { label: 'Cancelada', className: 'bg-slate-100 text-slate-600' },
|
||||
expired: { label: 'Expirada', className: 'bg-slate-100 text-slate-600' },
|
||||
overdue: {
|
||||
label: 'Devolução atrasada',
|
||||
className: 'bg-red-100 text-red-800',
|
||||
},
|
||||
};
|
||||
|
||||
export function ReservationStatus({ status }: { status: string }) {
|
||||
const item = statuses[status] ?? {
|
||||
label: status,
|
||||
className: 'bg-slate-100 text-slate-700',
|
||||
};
|
||||
|
||||
return (
|
||||
<Badge className={cn('border-0', item.className)}>{item.label}</Badge>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user