import { Skeleton } from "@mantine/core"; import gridClasses from "@/ee/base/styles/grid.module.css"; import classes from "@/ee/base/styles/base-table-skeleton.module.css"; const ROW_NUMBER_WIDTH = 64; const COLUMN_WIDTH = 180; const DEFAULT_COLUMN_COUNT = 6; const DEFAULT_ROW_COUNT = 10; // Deterministic widths prevent flicker between renders. const CELL_WIDTH_RATIOS = [0.78, 0.62, 0.84, 0.55, 0.71, 0.66]; const HEADER_WIDTH_RATIOS = [0.42, 0.58, 0.5, 0.64, 0.46, 0.54]; type BaseTableSkeletonProps = { // Match the eventual content shape to avoid a jarring size jump on swap. rows?: number; columns?: number; }; export function BaseTableSkeleton({ rows = DEFAULT_ROW_COUNT, columns = DEFAULT_COLUMN_COUNT, }: BaseTableSkeletonProps = {}) { const gridTemplateColumns = [ `${ROW_NUMBER_WIDTH}px`, ...Array.from({ length: columns }, () => `${COLUMN_WIDTH}px`), ].join(" "); return (