diff --git a/src/page/bootcamp/bootcamp.tsx b/src/page/bootcamp/bootcamp.tsx index 37725ed..18168e0 100644 --- a/src/page/bootcamp/bootcamp.tsx +++ b/src/page/bootcamp/bootcamp.tsx @@ -1,6 +1,6 @@ -import { useEffect } from 'react' +import { useState } from 'react' import { m } from 'framer-motion' -import { Box, Grid } from '@mui/material' +import { Pagination, Box, Grid } from '@mui/material' import { SCard } from 'theme/style' import { useGetAllBootcampQuery } from 'store/slice/bootcamp' import { BootcampSearch, BootcampCard } from 'section/bootcamp' @@ -11,8 +11,13 @@ import { ASSET } from 'config' import { LABEL, PLACEHOLDER } from 'constant' function Bootcamp() { + const [currentPage, setCurrentPage] = useState(1) const { data, error, isLoading } = useGetAllBootcampQuery() + const handlePageChange = (event: any, value: any) => { + setCurrentPage(value) + } + return ( + ) : ( - data?.data?.map((bootcamp: any, index: number) => ) + data?.data + ?.slice((currentPage - 1) * 6, currentPage * 6) + .map((bootcamp: any, index: number) => ) )} +