import { TableBody, TableCell, Table as TableComp, TableHead, TableHeader, TableRow, } from "@repo/shadcn-ui/components"; // SkeletonTable.tsx import * as React from "react"; import { SkeletonDataTableFooter } from './skeleton-data-table-footer.tsx'; export type SkeletonTableProps = { columns?: number; rows?: number; stickyHeader?: boolean; showFooter?: boolean; footerProps?: { pageIndex?: number; pageSize?: number; totalItems?: number }; } // Componente Skeleton de tabla genérico export const SkeletonDataTable = ({ columns = 6, rows = 10, stickyHeader = true, showFooter = true, footerProps, }: SkeletonTableProps) => { // Genera arrays para mapear const cols = React.useMemo(() => Array.from({ length: columns }), [columns]); const rws = React.useMemo(() => Array.from({ length: rows }), [rows]); return (
{cols.map((_, i) => (
))} {rws.map((_, r) => ( {cols.map((_, c) => (
{c > 0 && (
)} ))} ))} {showFooter && } Loading table…
); }