import "@shared/components/Skeleton.css";
export interface SkeletonProps {
/** Width as a CSS length (`100%`, `12rem`, …). Defaults to 100%. */
width?: string | number;
/** Height as a CSS length. Defaults to 0.75rem. */
height?: string | number;
/** Shape preset. `text` = pill-rounded line, `rect` = card / image area. */
shape?: "text" | "rect" | "circle";
/** For text shape, the number of stacked lines to render. */
lines?: number;
className?: string;
}
/**
* Shimmering placeholder for content that hasn't loaded yet. Replaces the
* ad-hoc `linear-gradient(...) shimmer 1.4s` blocks that were duplicated
* across the deployed-pipelines table, the activity feed, and the doc-type
* grid.
*/
export function Skeleton({
width = "100%",
height,
shape = "text",
lines = 1,
className,
}: SkeletonProps) {
const dim = (v: string | number | undefined) =>
typeof v === "number" ? `${v}px` : v;
if (shape === "text" && lines > 1) {
return (
{Array.from({ length: lines }).map((_, i) => (
))}
);
}
return (
);
}