import { Button } from "@/components/ui/button"; import { IconChevronLeft, IconChevronRight } from "@/components/ui/icons"; import { useT } from "@/stores/preferences-context"; export type TablePaginationProps = { /** Zero-based current page index. */ pageIndex: number; pageCount: number; pageSize: number; /** Total row count (across all pages). */ total: number; onPageChange: (pageIndex: number) => void; }; /** Footer: "X kayıttan a-b arası" + prev/next + "page / total". */ export function TablePagination(props: TablePaginationProps) { const t = useT(); const start = () => (props.total === 0 ? 0 : props.pageIndex * props.pageSize + 1); const end = () => Math.min((props.pageIndex + 1) * props.pageSize, props.total); return (
{t("common.pageRange", { start: start(), end: end(), total: props.total })}
{t("common.pageOf", { page: props.pageIndex + 1, total: props.pageCount })}
); }