51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import { Inbox } from "lucide-react";
|
|
import type { Quote, Store } from "../../lib/types";
|
|
import { QuoteCard } from "./QuoteCard";
|
|
import { EmptyState } from "../../components/EmptyState";
|
|
|
|
export interface LedgerTableProps {
|
|
store: Store;
|
|
quotes: Quote[];
|
|
expanded: Set<string>;
|
|
onToggleExpand: (id: string) => void;
|
|
onAccept: (id: string) => void;
|
|
onEdit: (id: string) => void;
|
|
}
|
|
|
|
// دفتر پیشنهادها — فهرست کارتها (هر پیشنهاد یک کارت خوانا)
|
|
export function LedgerTable({
|
|
store,
|
|
quotes,
|
|
expanded,
|
|
onToggleExpand,
|
|
onAccept,
|
|
onEdit,
|
|
}: LedgerTableProps) {
|
|
if (!quotes.length) {
|
|
return (
|
|
<div className="rounded-lg border border-line bg-panel">
|
|
<EmptyState icon={Inbox} text="پیشنهادی مطابق فیلترها یافت نشد" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="flex flex-col gap-3">
|
|
{quotes.map((q) => (
|
|
<QuoteCard
|
|
key={q.id}
|
|
store={store}
|
|
q={q}
|
|
expanded={expanded.has(q.id)}
|
|
onToggleExpand={() => onToggleExpand(q.id)}
|
|
onAccept={() => onAccept(q.id)}
|
|
onEdit={() => onEdit(q.id)}
|
|
/>
|
|
))}
|
|
<div className="py-1 text-center text-[11px] text-muted">
|
|
هشدار «منقضی» = قیمت پیشنهادی از تاریخ انقضا گذشته؛ برای پیشبینی قیمت، شمارش نمیشود.
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|