The-Swarm-Corporation / swarms-platform

The Agent Marketplace
https://swarms.world/
Other
30 stars 17 forks source link

Add Pagination with Expandable Row Feature in Table #162

Closed An525ish closed 2 weeks ago

An525ish commented 3 weeks ago

This PR introduces a PaginatedTable component that provides both pagination and expandable row features, improving data display and user interaction for larger datasets.

Key Changes and Features:

  1. Pagination Controls:

    • Enables navigation across pages, showing a specific number of rows per page.
    • Controls include "Previous" and "Next" buttons to navigate between pages, with visual indicators for the current page and total pages.
    • Configurable page size for flexibility in data presentation.
  2. Expandable Rows:

    • Rows can be expanded to reveal additional details without redirecting the user, creating a streamlined viewing experience.
    • Expandable rows are toggled via a button, with smooth animations for opening and closing.
    • Expands only relevant data, filtering columns where expanded views are needed, which keeps the component responsive and clean.
  3. Reusable Column-Based Structure:

    • Accepts dynamic column configurations, allowing the component to adapt to various data structures.
    • Supports custom render functions per column for flexibility in cell rendering, such as images or formatted content.
  4. Code Organization:

    • The toggleRow function efficiently manages expanded row states using a Set for O(1) access, making it performant for large datasets.
    • Modularized expandable row and pagination logic to enhance readability and reusability.

    Demo Video Representation with Dummy Data :

https://github.com/user-attachments/assets/d3136fbd-0fd2-4e8e-b249-775b2e67b6b3

vercel[bot] commented 3 weeks ago

@An525ish is attempting to deploy a commit to the swarms Team on Vercel.

A member of the Team first needs to authorize it.