import { ChevronLeft, ChevronRight } from 'lucide-react'; import { usePromptGroupsNav } from '~/hooks'; import PromptCard from './PromptCard'; import { Button } from '../ui'; export default function Prompts() { const { prevPage, nextPage, hasNextPage, promptGroups, hasPreviousPage, setPageSize, pageSize } = usePromptGroupsNav(); const renderPromptCards = (start = 0, count) => { return promptGroups .slice(start, count + start) .map((promptGroup) => ); }; const getRows = () => { switch (pageSize) { case 4: return [4]; case 8: return [4, 4]; case 12: return [4, 4, 4]; default: return []; } }; const rows = getRows(); return (
{rows.map((rowSize, index) => (
{renderPromptCards(rowSize * index, rowSize)}
))}
); }