import React from "react"; import { usePagination } from "react-use-pagination"; import bots from "../../static/bots.json"; import { useFilteredObjs } from "../libs/store"; import Card from "./Card"; import Paginate from "./Paginate"; export default function Adapter(): JSX.Element { const { filter, setFilter, filteredObjs: filteredBots, } = useFilteredObjs(bots); const props = usePagination({ totalItems: filteredBots.length, initialPageSize: 10, }); const { startIndex, endIndex } = props; const currentBots = filteredBots.slice(startIndex, endIndex + 1); return ( <>
setFilter(event.target.value)} />
{currentBots.map((bot, index) => ( ))}
); }