Overview
NVIDIA's product catalog contains a vast number of GPU models, making it challenging for users to browse them all at once. To improve user experience and application performance, we need to implement a robust client-side pagination system. This problem focuses on building a UI component that displays a list of GPU models, allowing users to navigate through pages efficiently.
What you need to do / Task
Your goal is to build a React component that displays a list of GPU models from a provided mock dataset, implementing client-side pagination.
- Display GPU Models: Render a list of GPU models, showing key details like
name and architecture.
- Implement Client-Side Pagination:
- Display a fixed number of GPU models per page (e.g., 5-10 items). You can choose and hardcode this value.
- Show pagination controls including "Previous", "Next", and a series of page numbers.
- Clicking "Previous" or "Next" should navigate to the adjacent page.
- Clicking a specific page number should navigate directly to that page.
- Handle Edge Cases:
- The "Previous" button should be disabled when on the first page.
- The "Next" button should be disabled when on the last page.
- The current active page number in the pagination controls should be clearly highlighted.
UI/UX expectations
- The main content area should display the list of GPU models. Each model can be represented as a simple card or list item.
- Pagination controls should be placed prominently below the list of GPU models.
- The pagination controls should include "Previous", "Next", and a reasonable range of page numbers (for the given mock data, displaying all page numbers is acceptable).
- The currently active page number should have distinct styling (e.g., bold text, different background).
- Disabled "Previous" and "Next" buttons should visually indicate they are unclickable (e.g., greyed out, lower opacity).
Acceptance criteria
- The application renders a list of GPU models.
- Only the correct subset of GPU models for the current page is displayed.
- "Previous" button navigates to the prior page and is disabled on the first page.
- "Next" button navigates to the subsequent page and is disabled on the last page.
- Clicking on a page number directly navigates to that page.
- The active page number is visually highlighted in the pagination controls.
- The number of items per page is consistent.