Skip to content

Commit 98b6350

Browse files
committed
add metrics page skeleton
1 parent c0ca818 commit 98b6350

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

ui/src/pages/metrics.tsx

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useStats } from '../queries/useStats.ts';
66
import { useDetailedStats } from '../queries/useDetailedStats.ts';
77
import { MetricPlot } from '../components/metrics/metric-plot.tsx';
88
import { MetricModal } from '../components/modals/metric-modal.tsx';
9+
import { CardSkeleton } from '../components/skeletons/card-skeleton';
910

1011

1112
interface MetricModalProps {
@@ -40,10 +41,39 @@ export const Metrics = () => {
4041
};
4142

4243
const { data: bedbaseStats } = useStats();
43-
const { data: detailedStats } = useDetailedStats();
44+
const { data: detailedStats, isLoading } = useDetailedStats();
4445

4546
const sliceIndex = 5;
4647

48+
if (isLoading) {
49+
return (
50+
<Layout title='BEDbase' footer>
51+
<div className="my-2">
52+
<Row>
53+
<Col sm={12} md={12}>
54+
<div className="mb-2">
55+
<CardSkeleton height="200px" />
56+
</div>
57+
</Col>
58+
</Row>
59+
<Row>
60+
<Col sm={5} md={5}>
61+
<div className="mb-2">
62+
<CardSkeleton height="300px" />
63+
</div>
64+
<div className="mb-2">
65+
<CardSkeleton height="300px" />
66+
</div>
67+
</Col>
68+
<Col sm={7} md={7}>
69+
<CardSkeleton height="100%" />
70+
</Col>
71+
</Row>
72+
</div>
73+
</Layout>
74+
);
75+
};
76+
4777
return (
4878
<Layout footer title='BEDbase' fullHeight>
4979
<Container fluid>

0 commit comments

Comments
 (0)