feat: add loading page for when dataset is loading

Originally there was a simple "Loading" text, however this looked bad and might lead a user to think that the page had frozen.

There is now a more comprehensive loading animation which users might be happy to sit on for a few minutes.
This commit is contained in:
2026-03-04 18:39:20 +00:00
parent 29c90ddfff
commit b6815c490a
4 changed files with 127 additions and 6 deletions

View File

@@ -136,7 +136,27 @@ const StatPage = () => {
getStats();
}, [datasetId])
if (loading) return <p style={{...styles.page, minWidth: "100vh", minHeight: "100vh"}}>Loading insights</p>;
if (loading) {
return (
<div style={styles.loadingPage}>
<div style={styles.loadingCard}>
<div style={styles.loadingHeader}>
<div style={styles.loadingSpinner} />
<div>
<h2 style={styles.loadingTitle}>Loading analytics</h2>
<p style={styles.loadingSubtitle}>Fetching summary, timeline, user, and content insights.</p>
</div>
</div>
<div style={styles.loadingSkeleton}>
<div style={{ ...styles.loadingSkeletonLine, ...styles.loadingSkeletonLineLong }} />
<div style={{ ...styles.loadingSkeletonLine, ...styles.loadingSkeletonLineMed }} />
<div style={{ ...styles.loadingSkeletonLine, ...styles.loadingSkeletonLineShort }} />
</div>
</div>
</div>
);
}
if (error) return <p style={{...styles.page}}>{error}</p>;
return (