Files
davila7--claude-code-templates/cli-tool/analytics-ui/src/components/Skeleton.tsx
T
wehub-resource-sync bb5c75ce05
Component Security Validation / Security Audit (push) Has been cancelled
Deploy to Cloudflare Pages / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:38:58 +08:00

37 lines
927 B
TypeScript

import React from 'react';
interface SkeletonProps {
height?: number | string;
width?: number | string;
className?: string;
style?: React.CSSProperties;
}
export function Skeleton({ height = 16, width = '100%', className = '', style }: SkeletonProps) {
return (
<div
className={`skeleton ${className}`}
style={{ height, width, ...style }}
/>
);
}
export function KPICardSkeleton() {
return (
<div className="card" style={{ minHeight: 110 }}>
<Skeleton height={11} width="55%" style={{ marginBottom: 14 }} />
<Skeleton height={44} width="70%" style={{ marginBottom: 10 }} />
<Skeleton height={11} width="40%" />
</div>
);
}
export function ChartCardSkeleton({ height = 220 }: { height?: number }) {
return (
<div className="card">
<Skeleton height={12} width="40%" style={{ marginBottom: 16 }} />
<Skeleton height={height} />
</div>
);
}