// The pager's page arithmetic, split out of Pager so that file exports only components (Fast Refresh) // and table chrome can gate on it without importing the control. /** How many pages `total` rows make at `size` (`size <= 0` = "All" = one page). */ export function pageCount(total: number, size: number): number { return size <= 0 ? 1 : Math.max(1, Math.ceil(total / size)); } /** Whether a pager would render anything — the ONE owner of that rule. Callers that wrap the pager * in their own chrome gate on this instead of re-deriving it: a drifted second copy is exactly what * left empty control bands behind on tables with nothing to page. */ export function hasPagerContent(total: number, size: number): boolean { return pageCount(total, size) > 1 || total > 0; }