diff --git a/components/DataGrid.tsx b/components/DataGrid.tsx index 1757c19..0bbc01b 100644 --- a/components/DataGrid.tsx +++ b/components/DataGrid.tsx @@ -630,6 +630,48 @@ const DataGrid: React.FC = ({ data }) => { )} + {/* Filter Totals Summary */} +
+
+
+ + Filtered Totals: +
+ {years.map((year) => { + const yearTotals = processedRows.reduce( + (acc, row) => { + const data = row.totalsByYear[year]; + if (data) { + acc.sellOut += data.sellOut; + acc.units += data.units; + } + return acc; + }, + { sellOut: 0, units: 0 } + ); + return ( +
+ {year} +
+ S.O: + + €{yearTotals.sellOut.toLocaleString(undefined, { maximumFractionDigits: 0 })} + +
+
+
+ Units: + + {yearTotals.units.toLocaleString()} + +
+
+ ); + })} +
+
+ + {/* Data Table */}