Add three new frontend page sections: - Industrial parks (khu-cong-nghiep): listing, detail, filter bar - Transfer listings (chuyen-nhuong): search, category tabs, detail - AI reports dashboard: list, create, viewer with TOC Includes components, API clients, hooks, server helpers, i18n keys, navigation links in public and dashboard layouts, and lint fixes. Co-Authored-By: Paperclip <noreply@paperclip.ing>
23 lines
921 B
TypeScript
23 lines
921 B
TypeScript
'use client';
|
|
|
|
import { CheckCircle, Loader2, XCircle } from 'lucide-react';
|
|
import type { ReportStatus } from '@/lib/reports-api';
|
|
|
|
const statusConfig: Record<ReportStatus, { label: string; icon: typeof CheckCircle; className: string }> = {
|
|
GENERATING: { label: 'Đang tạo...', icon: Loader2, className: 'text-blue-600 bg-blue-50' },
|
|
READY: { label: 'Hoàn thành', icon: CheckCircle, className: 'text-green-600 bg-green-50' },
|
|
FAILED: { label: 'Lỗi', icon: XCircle, className: 'text-red-600 bg-red-50' },
|
|
};
|
|
|
|
export function ReportStatusBadge({ status }: { status: ReportStatus }) {
|
|
const config = statusConfig[status];
|
|
const Icon = config.icon;
|
|
|
|
return (
|
|
<span className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium ${config.className}`}>
|
|
<Icon className={`h-3 w-3 ${status === 'GENERATING' ? 'animate-spin' : ''}`} />
|
|
{config.label}
|
|
</span>
|
|
);
|
|
}
|