/** * 廠商列表顯示元件 */ import { Phone, Mail, Package, Pencil, Trash2, Calendar, Eye } from "lucide-react"; import { Button } from "@/Components/ui/button"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/Components/ui/table"; import type { Supplier } from "@/types/vendor"; interface VendorListProps { suppliers: Supplier[]; searchQuery: string; onViewDetails: (supplier: Supplier) => void; onEdit: (supplier: Supplier) => void; onDelete: (supplier: Supplier) => void; } export default function VendorList({ suppliers, searchQuery, onViewDetails, onEdit, onDelete, }: VendorListProps) { const isEmpty = suppliers.length === 0; const emptyMessage = searchQuery ? "未找到符合條件的廠商" : "尚無廠商資料"; const formatDate = (dateString?: string) => { if (!dateString) return "-"; const date = new Date(dateString); return date.toLocaleDateString("zh-TW", { year: "numeric", month: "2-digit", day: "2-digit", }); }; return (