import { useRouter } from 'next/router'; import { FC } from 'react'; import { Button, Flex, Text } from '@chakra-ui/react'; import useGetColors from '../lib/hooks/useGetColors'; interface Props { allPages: number; num: string; } const paging: FC = ({ allPages, num }) => { const router = useRouter(); const startIndex = Number(num); const { textColor } = useGetColors(); const goPrev = () => { startIndex == 2 ? router.push('/') : router.push(`/page/${startIndex - 1}`); }; const goNext = () => { router.push(`/page/${startIndex + 1}`); }; return ( <> {startIndex > 1 ? ( ) : ( void 0 )} {num} / {allPages} {startIndex != allPages ? ( ) : ( void 0 )} ); }; export default paging;