mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 18:52:06 +00:00
Switch google fonts to use Next.js font optimization, animate comment fade in, and refactor beer like handler and comment submit handler.
33 lines
873 B
TypeScript
33 lines
873 B
TypeScript
import Link from 'next/link';
|
|
import { FaArrowLeft, FaArrowRight } from 'react-icons/fa';
|
|
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}
|
|
>
|
|
<FaArrowLeft />
|
|
</Link>
|
|
<button className="btn">Page {pageNum}</button>
|
|
<Link
|
|
className={`btn ${pageNum === pageCount ? 'btn-disabled' : ''}`}
|
|
href={{ pathname: '/beers', query: { page_num: pageNum + 1 } }}
|
|
scroll={false}
|
|
>
|
|
<FaArrowRight />
|
|
</Link>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default BeerIndexPaginationBar;
|