drift-quant / frontend /src /components /common /LoadingSkeleton.tsx
deveshc23
feat: Add Free Gradio Space support, Git LFS tracking for data artifacts, and Quant Allocator
3e33e2e
Raw History Blame Contribute Delete
1.19 kB
export function LoadingSkeleton({
lines = 4,
height = "20px",
className = "",
}: {
lines?: number;
height?: string | number;
className?: string;
}) {
const heightStyle = typeof height === "number" ? `${height}px` : height;
return (
<div className={`skeleton-container ${className}`}>
{Array.from({ length: lines }).map((_, i) => (
<div
key={i}
className="skeleton-bar"
style={{ height: heightStyle, width: i === lines - 1 ? "60%" : "100%" }}
/>
))}
</div>
);
}
export function CardSkeleton() {
return (
<div className="skeleton-card">
<div className="skeleton-bar" style={{ height: "14px", width: "40%", marginBottom: "12px" }} />
<div className="skeleton-bar" style={{ height: "32px", width: "70%", marginBottom: "8px" }} />
<div className="skeleton-bar" style={{ height: "12px", width: "50%" }} />
</div>
);
}
export function ChartSkeleton({ height = 320 }: { height?: number }) {
return (
<div className="skeleton-chart" style={{ height: `${height}px` }}>
<div className="spinner" />
<span>Loading historical research series...</span>
</div>
);
}