import Button from "./Button";
import tw, { styled } from "twin.macro"
import 'styled-components/macro'
function CustomBtn({children, setPage, currentPage, page, css, ...props}){
console.log(css)
return
}
export default function Pagination({ currentPage, maxPages, setPage, ...props }) {
function RenderButtons() {
switch (maxPages) {
case 1:
return 1;
case 2:
return <>
1
2
>
case 3:
return <>
1
2
3
>
case 4:
return <>
1
2
3
4
>
case 5:
return <>
1
2
3
4
5
>
default: {
return <>
{currentPage > 3 && <}
{Math.max(currentPage-2,1)}
{Math.max(currentPage-2,1)+1}
{Math.max(currentPage-2,1)+2}
{(maxPages - currentPage) >= 1 && {Math.max(currentPage-2,1)+3}}
{(maxPages - currentPage) >= 2 && {Math.max(currentPage-2,1)+4}}
{(maxPages - currentPage) >= 3 && >}
>
}
}
}
return (
)
}