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 + +
+ + +
+ + } + > + + + +
-
-
- -
- -
+
+ +
+