diff --git a/src/components/PricingView.tsx b/src/components/PricingView.tsx index a99af10..1f2896a 100644 --- a/src/components/PricingView.tsx +++ b/src/components/PricingView.tsx @@ -51,6 +51,8 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, const [filterMode, setFilterMode] = useState('all_errors'); const [search, setSearch] = useState(''); const [searchMode, setSearchMode] = useState<'all' | 'selected'>('all'); + const [currentPage, setCurrentPage] = useState(1); + const pageSize = 100; const [columnWidths, setColumnWidths] = useState>({ articleNo: 100, articleName: 220, @@ -387,6 +389,14 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, return sorted; }, [filteredRows, sortConfig]); + // ── Pagination ───────────────────────────────────────────────────────── + const paginatedRows = useMemo(() => { + const start = (currentPage - 1) * pageSize; + return sortedRows.slice(start, start + pageSize); + }, [sortedRows, currentPage]); + + const totalPages = Math.ceil(sortedRows.length / pageSize); + const handleSort = (key: string | number) => { setSortConfig(prev => { if (prev.key === key) { @@ -713,7 +723,7 @@ export function PricingView({ data, headers, onSaveRow, onCaptureState, onEdit, {FILTERS.map(f => ( + + + {currentPage} / {totalPages} + + + + )} -

+ ); }