From 0f293fdd8cf50f2a878e7b466d5c9254fe6ab810 Mon Sep 17 00:00:00 2001 From: Emanuel Almeida Date: Fri, 13 Feb 2026 18:23:44 +0000 Subject: [PATCH] Fix: TypeScript error in ChartCard Error: 'percent' is possibly 'undefined' Fix: (percent || 0) para garantir fallback Co-Authored-By: Claude Sonnet 4.5 --- src/components/dashboard/chart-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/dashboard/chart-card.tsx b/src/components/dashboard/chart-card.tsx index db4c1f4..3f2ce50 100644 --- a/src/components/dashboard/chart-card.tsx +++ b/src/components/dashboard/chart-card.tsx @@ -163,7 +163,7 @@ export function ChartCard({ cx="50%" cy="50%" labelLine={false} - label={({ name, percent }) => `${name} (${(percent * 100).toFixed(0)}%)`} + label={({ name, percent }) => `${name} (${((percent || 0) * 100).toFixed(0)}%)`} outerRadius={100} fill="#8884d8" dataKey={dataKey}