Frontendx
README.md
SOLUTION.md
main.tsxentry
App.tsx
App.css
index.html
vite.config.ts
Installed
react@^19.2.0
react-dom@^19.2.0

Pagination Component in React

Prompt

Build a fully reusable controlled pagination component that accepts totalItems/itemsPerPage/currentPage as props and emits onPageChange callback. Renders page number buttons with prev/next controls. Disable Prev on first page and Next on last page. SDE2: Add ellipsis for large page counts (e.g. 1 2 ... 7 8 9 ... 20).

Calculate totalPages = Math.ceil(totalItems
Test Results

Pagination Component in React

Build a fully reusable controlled pagination component that accepts totalItems/itemsPerPage/currentPage as props and emits onPageChange callback. Renders page number buttons with prev/next controls. Disable Prev on first page and Next on last page. SDE2: Add ellipsis for large page counts (e.g. 1 2 ... 7 8 9 ... 20).