pagination: fix offset display when there are 0 results

This commit is contained in:
Min RK
2024-03-08 09:06:46 +01:00
parent 8cbe1eac2b
commit bc3bb47672

View File

@@ -5,11 +5,12 @@ import { FormControl } from "react-bootstrap";
import "./pagination-footer.css"; import "./pagination-footer.css";
const PaginationFooter = (props) => { const PaginationFooter = (props) => {
let { offset, limit, visible, total, next, prev, handleLimit } = props; const { offset, limit, visible, total, next, prev, handleLimit } = props;
return ( return (
<div className="pagination-footer"> <div className="pagination-footer">
<p> <p>
Displaying {offset + 1}-{offset + visible} {total ? `of ${total}` : ""} Displaying {visible ? offset + 1 : offset}-{offset + visible}{" "}
{total ? `of ${total}` : ""}
<br /> <br />
{offset >= 1 ? ( {offset >= 1 ? (
<button className="btn btn-sm btn-light spaced"> <button className="btn btn-sm btn-light spaced">