mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 23:35:45 +00:00
chore: disabled export button if filter is not selected yet
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
|||||||
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
|
import { ProjectFlockKandang } from '@/types/api/production/project-flock-kandang';
|
||||||
import { isResponseError } from '@/lib/api-helper';
|
import { isResponseError } from '@/lib/api-helper';
|
||||||
import Pagination from '@/components/Pagination';
|
import Pagination from '@/components/Pagination';
|
||||||
|
import { ProductionResultReportApi } from '@/services/api/report/production-result';
|
||||||
|
|
||||||
const ProductionResultContent = () => {
|
const ProductionResultContent = () => {
|
||||||
const [projectFlockKandangs, setProjectFlockKandangs] = useState<
|
const [projectFlockKandangs, setProjectFlockKandangs] = useState<
|
||||||
@@ -145,8 +146,11 @@ const ProductionResultContent = () => {
|
|||||||
|
|
||||||
const exportToExcelHandler = async () => {
|
const exportToExcelHandler = async () => {
|
||||||
setIsLoadingExportingToExcel(true);
|
setIsLoadingExportingToExcel(true);
|
||||||
// TODO: Implement export functionality in API service first if needed
|
|
||||||
toast.error('Fitur export belum tersedia');
|
await ProductionResultReportApi.exportProductionResultToExcel(
|
||||||
|
projectFlockKandangs
|
||||||
|
);
|
||||||
|
|
||||||
setIsLoadingExportingToExcel(false);
|
setIsLoadingExportingToExcel(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -319,7 +323,13 @@ const ProductionResultContent = () => {
|
|||||||
align='end'
|
align='end'
|
||||||
direction='bottom'
|
direction='bottom'
|
||||||
trigger={
|
trigger={
|
||||||
<Button>
|
<Button
|
||||||
|
disabled={
|
||||||
|
!selectedArea ||
|
||||||
|
!selectedLocation ||
|
||||||
|
!selectedProjectFlock
|
||||||
|
}
|
||||||
|
>
|
||||||
Export{' '}
|
Export{' '}
|
||||||
<Icon
|
<Icon
|
||||||
icon='heroicons-outline:download'
|
icon='heroicons-outline:download'
|
||||||
|
|||||||
Reference in New Issue
Block a user