diff --git a/src/app/DRE/analitico.tsx b/src/app/DRE/analitico.tsx index f43c1e5..ddfd3fe 100644 --- a/src/app/DRE/analitico.tsx +++ b/src/app/DRE/analitico.tsx @@ -24,7 +24,7 @@ import { SelectContent, SelectItem, } from "@/components/ui/select"; -import { Download } from "lucide-react"; +import { Download, Filter, X } from "lucide-react"; import * as XLSX from 'xlsx'; interface AnaliticoItem { @@ -255,6 +255,7 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) { const clearFilters = () => { setConditions([{ column: "", operator: "contains", value: "" }]); setColumnFilters([]); + setGlobalFilter(""); }; const totalValor = data.reduce((sum, item) => { @@ -328,33 +329,44 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) { - {/* Controls */} -
- ) => setGlobalFilter(e.target.value)} - className="w-64 bg-white border-gray-300 focus:border-blue-500 focus:ring-blue-500" - /> - - {data.length > 0 && ( - - )} -
+ {/* Controls */} +
+ ) => setGlobalFilter(e.target.value)} + className="w-64 bg-white border-gray-300 focus:border-blue-500 focus:ring-blue-500" + /> + + {(columnFilters.length > 0 || globalFilter) && ( + + )} + {data.length > 0 && ( + + )} +
{/* Table Container */} @@ -431,39 +443,40 @@ export default function AnaliticoComponent({ filtros }: AnaliticoProps) { )} - - - {/* Summary Footer */} - {data.length > 0 && ( -
-
-
-
- - - + + {/* Summary Footer - Integrado */} + {data.length > 0 && ( +
+
+
+
+ + + +
+
+

+ Total de Registros: {table.getRowModel().rows.length} +

+

Transações encontradas

+
-
-

- Total de Registros: {table.getRowModel().rows.length} -

-

Transações encontradas

+
+

+ + Valor Total: {new Intl.NumberFormat('pt-BR', { + style: 'currency', + currency: 'BRL', + }).format(totalValor)} + +

+

Soma de todos os valores

-
-

- - Valor Total: {new Intl.NumberFormat('pt-BR', { - style: 'currency', - currency: 'BRL', - }).format(totalValor)} - -

-

Soma de todos os valores

-
+ )}
- )} +
{/* Advanced Filters Dialog */}