Files
the-biergarten-app/components/BeerIndex/BeerIndexPaginationBar.tsx
Aaron William Po a4362a531c Add custom hooks for time distance and retrieving like count
Documentation added to all custom hooks
2023-04-03 23:32:32 -04:00

33 lines
787 B
TypeScript

import Link from 'next/link';
import { FC } from 'react';
interface PaginationProps {
pageNum: number;
pageCount: number;
}
const BeerIndexPaginationBar: FC<PaginationProps> = ({ pageCount, pageNum }) => {
return (
<div className="btn-group">
<Link
className={`btn ${pageNum === 1 ? 'btn-disabled' : ''}`}
href={{ pathname: '/beers', query: { page_num: pageNum - 1 } }}
scroll={false}
>
«
</Link>
<button className="btn">Page {pageNum}</button>
<Link
className={`btn ${pageNum === pageCount ? 'btn-disabled' : ''}`}
href={{ pathname: '/beers', query: { page_num: pageNum + 1 } }}
scroll={false}
>
»
</Link>
</div>
);
};
export default BeerIndexPaginationBar;