import React from 'react'
export default function ListPagination({
totalItems = 0,
currentPage = 1,
pageSize = 50,
onPageChange,
loading = false,
}) {
const total = Math.max(0, Number(totalItems) || 0)
const tamanhoPagina = Math.max(1, Number(pageSize) || 50)
const totalPages = Math.max(1, Math.ceil(total / tamanhoPagina))
const paginaAtual = Math.min(Math.max(1, Number(currentPage) || 1), totalPages)
const startIndex = total ? ((paginaAtual - 1) * tamanhoPagina) + 1 : 0
const endIndex = total ? Math.min(total, paginaAtual * tamanhoPagina) : 0
return (
{total ? `Exibindo ${startIndex}-${endIndex} de ${total}` : 'Exibindo 0 de 0'}
Página {paginaAtual} de {totalPages}
)
}