From 607bf281211d92bed7f3e8ae8c96e5ce709d6410 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 28 Jan 2026 15:10:36 +0700 Subject: [PATCH] refactor(FE): Refactor Uniformity header and add filter badge --- .../production/uniformity/UniformityChart.tsx | 2 +- .../production/uniformity/UniformityTable.tsx | 177 +++++++++++++----- 2 files changed, 135 insertions(+), 44 deletions(-) diff --git a/src/components/pages/production/uniformity/UniformityChart.tsx b/src/components/pages/production/uniformity/UniformityChart.tsx index 6ddf50d3..db37c8f1 100644 --- a/src/components/pages/production/uniformity/UniformityChart.tsx +++ b/src/components/pages/production/uniformity/UniformityChart.tsx @@ -101,7 +101,7 @@ const UniformityChart = ({ const shouldShowEmptyState = !isFiltered; return ( -
+
{ [] ); + // ===== CALCULATE FILTER COUNT ===== + const filterCount = useMemo(() => { + let count = 0; + + if (filterStartDate && filterEndDate) { + count += 1; + } + + if (filterLocation) { + count += 1; + } + + if (filterProjectFlock) { + count += 1; + } + + if (filterKandang) { + count += 1; + } + + return count; + }, [ + filterStartDate, + filterEndDate, + filterLocation, + filterProjectFlock, + filterKandang, + ]); + + const isFilterActive = filterCount > 0; + return ( <> -
-
- - - -
- -
- - - - - Export +
+
+
+ + - } - align='end' - > - - - - - + +
+ +
+ + + +
+ + + Export + +
+ + +
+ + } + > + + + +
-
-
- -
- -
+
+ +
+