fix: evitar client-side crash no AdminDashboard caso api retorne erro
Build and Deploy (Gitea Actions) / build-and-deploy (push) Has been cancelled Details

This commit is contained in:
Sidney 2026-06-07 21:24:54 -03:00
parent 2f26053a8d
commit 793135850b
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ export default function AdminDashboard({ onNavigate }: Props) {
const maxRevenue = Math.max(...revenueData); const maxRevenue = Math.max(...revenueData);
if (loading) return <div className="p-8 text-center" style={{color: 'var(--text-muted)'}}>Carregando dashboard...</div>; if (loading) return <div className="p-8 text-center" style={{color: 'var(--text-muted)'}}>Carregando dashboard...</div>;
if (!data) return <div className="p-8 text-center" style={{color: 'var(--text-muted)'}}>Erro ao carregar dados.</div>; if (!data || data.error) return <div className="p-8 text-center" style={{color: 'var(--danger)'}}>Erro ao carregar dados: {data?.error || 'Desconhecido'}</div>;
const totalTenants = data.activeTenants + data.trialTenants + data.pastDueTenants; const totalTenants = data.activeTenants + data.trialTenants + data.pastDueTenants;