36 lines
890 B
TypeScript
36 lines
890 B
TypeScript
|
|
'use client';
|
||
|
|
|
||
|
|
import { Loader2 } from 'lucide-react';
|
||
|
|
|
||
|
|
import { Badge } from '@/components/ui/badge';
|
||
|
|
|
||
|
|
type ReportStatus = 'queued' | 'processing' | 'ready' | 'failed';
|
||
|
|
|
||
|
|
interface ReportStatusBadgeProps {
|
||
|
|
status: ReportStatus;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function ReportStatusBadge({ status }: ReportStatusBadgeProps) {
|
||
|
|
switch (status) {
|
||
|
|
case 'queued':
|
||
|
|
return <Badge variant="outline">Queued</Badge>;
|
||
|
|
case 'processing':
|
||
|
|
return (
|
||
|
|
<Badge variant="secondary" className="gap-1">
|
||
|
|
<Loader2 className="h-3 w-3 animate-spin" />
|
||
|
|
Processing
|
||
|
|
</Badge>
|
||
|
|
);
|
||
|
|
case 'ready':
|
||
|
|
return (
|
||
|
|
<Badge className="bg-green-600 text-white hover:bg-green-700">
|
||
|
|
Ready
|
||
|
|
</Badge>
|
||
|
|
);
|
||
|
|
case 'failed':
|
||
|
|
return <Badge variant="destructive">Failed</Badge>;
|
||
|
|
default:
|
||
|
|
return <Badge variant="outline">{status}</Badge>;
|
||
|
|
}
|
||
|
|
}
|