diff --git a/src/app/DRE/page.tsx b/src/app/DRE/page.tsx index 32d8563..cf698a8 100644 --- a/src/app/DRE/page.tsx +++ b/src/app/DRE/page.tsx @@ -2,9 +2,7 @@ import Teste from './teste'; export default function DrePage() { return ( -
-

DRE-GERENCIAL

- +
); diff --git a/src/app/DRE/teste.tsx b/src/app/DRE/teste.tsx index afdd66e..f53ac0e 100644 --- a/src/app/DRE/teste.tsx +++ b/src/app/DRE/teste.tsx @@ -1,14 +1,7 @@ 'use client'; import { Button } from '@/components/ui/button'; -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from '@/components/ui/table'; +// Removed unused table imports import { ArrowDown, ArrowUp, ArrowUpDown, BarChart3 } from 'lucide-react'; import { useEffect, useState } from 'react'; @@ -479,33 +472,24 @@ export default function Teste() { } const hierarchicalData = buildHierarchicalData(); - const totalGeral = data.reduce( - (sum, item) => sum + parseFloat(item.valor), - 0 - ); return ( -
-
-

DRE Gerencial - Hierárquica

-
-

- Total Geral: {formatCurrency(totalGeral)} -

-
+
+
+

DRE Gerencial

-
+
{/* Header fixo separado */}
-
+
{mesesDisponiveis.map((mes) => ( -
+
{mes}
))} -
+
- - - - +
+ {hierarchicalData.map((row, index) => ( +
+
+ {renderCellContent(row)} +
{mesesDisponiveis.map((mes) => ( - - ))} - - - - - {hierarchicalData.map((row, index) => ( - - - {renderCellContent(row)} - - {mesesDisponiveis.map((mes) => ( - - {row.valoresPorMes && row.valoresPorMes[mes] - ? formatCurrency(row.valoresPorMes[mes]) - : '-'} - - ))} - - {formatCurrency(row.total!)} - - - ))} - -
+ {row.valoresPorMes && row.valoresPorMes[mes] + ? formatCurrency(row.valoresPorMes[mes]) + : '-'} +
+ ))} +
+ {formatCurrency(row.total!)} +
+
+ ))} +
);