import style from "./style.module.scss";
import {
ChevronRight,
ChevronLeft,
} from "preact-feather";
import cn from "classnames";
const maxNumber = 10;
export function Pagination(props: {
pageCount: number;
page: number;
setPage: (page: number) => void;
}) {
return (
props.setPage(Math.max(props.page - 1, 0))}
title="Précédent"
>
{
Array.from({length: props.pageCount}, (_, i) => i)
.map(n => (
props.setPage(n)}
>
{n + 1}
))
}
= props.pageCount - 1})}
onClick={() => props.setPage(Math.min(props.page + 1, props.pageCount - 1))}
title="Suivant"
>
);
}