diff --git a/src/shared/components/Table.js b/src/shared/components/Table.js index a30a8f5..3899da9 100644 --- a/src/shared/components/Table.js +++ b/src/shared/components/Table.js @@ -101,49 +101,53 @@ const Table = ({ return value || '-'; }; - const MobileCard = ({ item }) => ( -
-
-
- {columns.slice(0, 2).map((column) => ( -
- {renderCellContent(item, column)} -
- ))} -
-
- {columns.slice(2, 4).map((column) => ( -
{renderCellContent(item, column)}
- ))} -
+ const MobileCard = ({ item }) => { + const visible = columns.filter((col) => !col.mobileHidden); + const [primary, ...rest] = visible; + return ( +
+ {primary && ( +
+ {renderCellContent(item, primary)} +
+ )} + {rest.length > 0 && ( +
+ {rest.map((column) => ( +
+
+ {column.label} +
+
+ {renderCellContent(item, column)} +
+
+ ))} +
+ )}
- {columns.length > 4 && ( -
- {columns.slice(4).map((column) => ( -
- {column.label}: {renderCellContent(item, column)} -
- ))} -
- )} -
- ); + ); + }; - const MobileSkeletonCard = () => ( -
-
-
- - -
-
- - -
+ const MobileSkeletonCard = () => { + const visibleCount = columns.filter((col) => !col.mobileHidden).length; + const restCount = Math.min(Math.max(0, visibleCount - 1), 4); + return ( +
+ + {restCount > 0 && ( +
+ {Array.from({ length: restCount }).map((_, i) => ( +
+ + +
+ ))} +
+ )}
- -
- ); + ); + }; const getPageNumbers = () => { const pages = [];