Add route-based code splitting and loading skeletons

- Lazy-load Dashboard, Comparison, Slides via React.lazy + Suspense
- Main bundle reduced from 606KB to 256KB
- Replace full-screen spinner with skeleton cards during load
- Skeleton used for both initial data fetch and route transitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
fahed
2026-03-25 18:10:42 +03:00
parent cd1e395ffa
commit 30ea4b6ecb
3 changed files with 113 additions and 12 deletions

View File

@@ -0,0 +1,27 @@
import React from 'react';
function SkeletonCard({ wide = false }: { wide?: boolean }) {
return (
<div className={`skeleton-card ${wide ? 'skeleton-card-wide' : ''}`}>
<div className="skeleton-line skeleton-line-short" />
<div className="skeleton-line skeleton-line-tall" />
</div>
);
}
export default function LoadingSkeleton() {
return (
<div className="skeleton-container">
<div className="skeleton-stats">
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
<SkeletonCard />
</div>
<div className="skeleton-charts">
<SkeletonCard wide />
<SkeletonCard wide />
</div>
</div>
);
}