"use client" import { Button } from "@/components/ui/button" interface ListPaginationProps { page: number pageSize: number totalItems: number itemLabel: string onPageChange: (page: number) => void } export function ListPagination({ page, pageSize, totalItems, itemLabel, onPageChange, }: ListPaginationProps) { const totalPages = Math.max(1, Math.ceil(totalItems / pageSize)) const start = totalItems === 0 ? 0 : (page - 1) * pageSize + 1 const end = Math.min(page * pageSize, totalItems) if (totalItems <= pageSize) { return null } return (

Showing {start}-{end} of {totalItems} {itemLabel}

Page {page} of {totalPages}
) }