const PAGE_SIZES = [25, 50, 100]; export function Pagination({ id, page = 0, size = 25, totalItems = 0, totalPages = 0, label = 'записей', onPage, onSize }) { const total = Number(totalItems || 0); const pages = Math.max(Number(totalPages || 0), total ? 1 : 0); const current = Number(page || 0); const pageSize = Number(size || 25); const start = total ? current * pageSize + 1 : 0; const end = Math.min((current + 1) * pageSize, total); return (
Показано {start}–{end} из {total} {label}
{pages ? current + 1 : 0} / {pages}
); }