From fe2d8c4e9b7fd2be1e14753b6f5f674fffdf348a Mon Sep 17 00:00:00 2001 From: root Date: Fri, 12 Jun 2026 12:21:23 +0000 Subject: [PATCH] fix: restore deleted data preparation vars in AdminDashboard (TDZ crash) --- src/components/admin/AdminDashboard.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/admin/AdminDashboard.jsx b/src/components/admin/AdminDashboard.jsx index 875ea66..8fae3ae 100644 --- a/src/components/admin/AdminDashboard.jsx +++ b/src/components/admin/AdminDashboard.jsx @@ -93,6 +93,14 @@ export const AdminDashboard = () => { const { stats, statusDist, dailyTrend, driverStats, economics, isLoading, error, refetch } = useAdminStats(period); const { stats: pickupStats, isLoading: pickupLoading } = usePickupStats(period); + // ── Responsive Layout Values (must be before early returns) ──────────────── + const chartHeight = mobile ? 200 : 240; + const kpiMin = mobile ? '80px' : '110px'; + const chartGridCols = mobile ? '1fr' : '1fr 2fr'; + const driverLabelWidth = mobile ? 80 : 120; + const fontSize = mobile ? { xs: '0.6rem', s: '0.7rem', m: '0.78rem', l: '0.85rem', xl: '1rem' } + : { xs: '0.65rem', s: '0.68rem', m: '0.78rem', l: '0.85rem', xl: '1.1rem' }; + // ── Loading / Error States ───────────────────────────────────────────────── if (isLoading) { return ( @@ -159,14 +167,6 @@ export const AdminDashboard = () => { { label: 'Отмена', value: econ.cancelled_count || 0, color: '#ef4444' }, ]; - // ── Responsive Layout Values ────────────────────────────────────────────── - const chartHeight = mobile ? 200 : 240; - const kpiMin = mobile ? '80px' : '110px'; - const chartGridCols = mobile ? '1fr' : '1fr 2fr'; - const driverLabelWidth = mobile ? 80 : 120; - const fontSize = mobile ? { xs: '0.6rem', s: '0.7rem', m: '0.78rem', l: '0.85rem', xl: '1rem' } - : { xs: '0.65rem', s: '0.68rem', m: '0.78rem', l: '0.85rem', xl: '1.1rem' }; - // ── Render ───────────────────────────────────────────────────────────────── return (