fix: evitar client-side crash no AdminDashboard caso api retorne erro
Build and Deploy (Gitea Actions) / build-and-deploy (push) Has been cancelled
Details
Build and Deploy (Gitea Actions) / build-and-deploy (push) Has been cancelled
Details
This commit is contained in:
parent
2f26053a8d
commit
793135850b
|
|
@ -36,7 +36,7 @@ export default function AdminDashboard({ onNavigate }: Props) {
|
|||
const maxRevenue = Math.max(...revenueData);
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue