import React from 'react';
import { Skeleton } from '@patternfly/react-core';
import { Table, Thead, Tbody, Tr, Th, Td } from '@patternfly/react-table';
/** Props for the {@link TableSkeleton} loading placeholder. */
interface TableSkeletonProps {
/** Number of skeleton columns to render. */
columns: number;
/** Number of skeleton rows to render. Defaults to `5`. */
rows?: number;
}
/**
* Renders a skeleton loading placeholder that mimics the shape of a table.
*
* Used by {@link TableContainer} as the default loading state. Renders
* PatternFly `Skeleton` bars in a table layout with varying widths to
* create a natural shimmer effect.
*
* @example
* ```tsx
*
* ```
*/
export const TableSkeleton: React.FC = ({ columns, rows = 5 }) => (
{Array.from({ length: columns }, (_, i) => (
|
|
))}
{Array.from({ length: rows }, (_r, rowIdx) => (
{Array.from({ length: columns }, (_c, colIdx) => (
|
|
))}
))}
);