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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user