From 1571d796858beacda40424477e2d7a78ed5d8805 Mon Sep 17 00:00:00 2001 From: ValdiANS Date: Mon, 5 Jan 2026 11:18:19 +0700 Subject: [PATCH] chore: disabled export button if filter is not selected yet --- .../ProductionResultContent.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/components/pages/report/production-result/ProductionResultContent.tsx b/src/components/pages/report/production-result/ProductionResultContent.tsx index 6fc8f7ea..ae6f744b 100644 --- a/src/components/pages/report/production-result/ProductionResultContent.tsx +++ b/src/components/pages/report/production-result/ProductionResultContent.tsx @@ -24,6 +24,7 @@ import { import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang'; import { isResponseError } from '@/lib/api-helper'; import Pagination from '@/components/Pagination'; +import { ProductionResultReportApi } from '@/services/api/report/production-result'; const ProductionResultContent = () => { const [projectFlockKandangs, setProjectFlockKandangs] = useState< @@ -145,8 +146,11 @@ const ProductionResultContent = () => { const exportToExcelHandler = async () => { setIsLoadingExportingToExcel(true); - // TODO: Implement export functionality in API service first if needed - toast.error('Fitur export belum tersedia'); + + await ProductionResultReportApi.exportProductionResultToExcel( + projectFlockKandangs + ); + setIsLoadingExportingToExcel(false); }; @@ -319,7 +323,13 @@ const ProductionResultContent = () => { align='end' direction='bottom' trigger={ -