Improve admin analytics and user management UI

Refactored admin users page to use client-side fetching, loading states, and search functionality. Enhanced AdminAnalytics with a best month (YTD) card and removed debug logging. Improved SystemStatusCard formatting and removed console logs. Fixed profit chart period selection logic. Minor formatting fix in nav-item component.
This commit is contained in:
g
2025-11-30 15:59:05 +00:00
parent 4ef0fd1a68
commit bb3dcaaca2
6 changed files with 274 additions and 163 deletions

View File

@@ -45,8 +45,9 @@ export default function ProfitAnalyticsChart({ timeRange, dateRange, hideNumbers
try {
setIsLoading(true);
setError(null);
// Use dateRange if provided, otherwise fall back to timeRange
const response = await getProfitOverview(dateRange || timeRange || '30');
// Use dateRange if provided, otherwise fall back to timeRange, otherwise default to '30'
const periodOrRange = dateRange || (timeRange ? timeRange : '30');
const response = await getProfitOverview(periodOrRange);
setData(response);
} catch (error) {
console.error('Error fetching profit data:', error);