'use client'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { formatPrice } from '@/lib/currency'; import type { ValuationHistoryItem } from '@/lib/valuation-api'; interface ValuationHistoryProps { items: ValuationHistoryItem[]; total: number; page: number; onPageChange: (page: number) => void; onSelect: (id: string) => void; isLoading?: boolean; } const PROPERTY_TYPE_LABELS: Record = { APARTMENT: 'Căn hộ', HOUSE: 'Nhà riêng', VILLA: 'Biệt thự', LAND: 'Đất nền', OFFICE: 'Văn phòng', SHOPHOUSE: 'Shophouse', }; export function ValuationHistory({ items, total, page, onPageChange, onSelect, isLoading, }: ValuationHistoryProps) { const totalPages = Math.ceil(total / 10); return ( Lịch sử định giá {total} lần định giá trước đó {isLoading ? (
Đang tải...
) : items.length === 0 ? (
Chưa có lịch sử định giá
) : ( <>
{items.map((item) => ( ))}
{totalPages > 1 && (
Trang {page}/{totalPages}
)} )}
); }