import { ChevronLeft, ChevronRight } from 'lucide-react' import { Button } from '@/app/components/ui/button' import { useT } from '@/app/lib/i18n/MessagesProvider' interface TablePagerProps { /** 1-based. */ page: number pageSize: number total: number onPageChange: (page: number) => void isLoading?: boolean } /** * The one pager every paged listing uses (fit-admin-listing-pages). It sticks to the bottom of the * screen while its table is on screen, so it is visible without scrolling. */ export function TablePager({ page, pageSize, total, onPageChange, isLoading = false }: TablePagerProps) { const t = useT() const pageCount = Math.max(1, Math.ceil(total / pageSize)) const first = (page - 1) * pageSize + 1 const last = Math.min(page * pageSize, total) const range = total === 0 ? t('PagerEmpty') : t('PagerRange', { first, last, total }) return (

{range}

{t('PagerPageOf', { page, pages: pageCount })}
) }