import { useMemo } from 'react'; import type { ColumnSizingState } from '@tanstack/react-table'; import { Skeleton } from 'antd'; import { TableColumnDef } from './types'; import { getColumnWidthStyle } from './utils'; import tableStyles from './TanStackTable.module.scss'; import styles from './TanStackTableSkeleton.module.scss'; type TanStackTableSkeletonProps = { columns: TableColumnDef[]; rowCount: number; isDarkMode: boolean; columnSizing?: ColumnSizingState; }; export function TanStackTableSkeleton({ columns, rowCount, isDarkMode, columnSizing, }: TanStackTableSkeletonProps): JSX.Element { const rows = useMemo( () => Array.from({ length: rowCount }, (_, i) => i), [rowCount], ); return ( {columns.map((column, index) => ( ))} {columns.map((column) => ( ))} {rows.map((rowIndex) => ( {columns.map((column) => ( ))} ))}
{typeof column.header === 'function' ? ( ) : ( column.header )}
); }