From 88ff7f47d70eb6aa430656d32d5477b145f24d91 Mon Sep 17 00:00:00 2001 From: wahyuun Date: Wed, 8 Nov 2023 22:27:16 +0700 Subject: [PATCH] add loader --- .../SimproV2/CreatedProyek/AsignCustProject.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/views/SimproV2/CreatedProyek/AsignCustProject.js b/src/views/SimproV2/CreatedProyek/AsignCustProject.js index dca803a..55c1dd6 100644 --- a/src/views/SimproV2/CreatedProyek/AsignCustProject.js +++ b/src/views/SimproV2/CreatedProyek/AsignCustProject.js @@ -1,7 +1,7 @@ import React, { useEffect, useState, useMemo } from 'react' import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Button, Form } from 'reactstrap'; -import { Table, Tooltip } from 'antd'; +import { Table, Tooltip, Spin } from 'antd'; import 'antd/dist/antd.css'; import moment from 'moment'; import { @@ -25,9 +25,11 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy const [alertDelete, setAlertDelete] = useState(false) const [idDelete, setIdDelete] = useState(0) const [openDialogFormTools, setOpenDialogFormTools] = useState(false) + const [loading, setLoading] = useState(true); useEffect(() => { - if (idTask > 0) { + if (idTask > 0) { + setLoading(true); getDataAssignHr(); } }, [openDialog]); @@ -63,8 +65,10 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy if (result && result.data && result.data.code == 200) { let dataRes = result.data.data || [] const filteredData = dataRes.filter(item => item.is_customer === true); - setdataUserToProject(filteredData); + setdataUserToProject(filteredData); + setLoading(false); } else { + setLoading(false); NotificationManager.error('Gagal Mengambil Data!!', 'Failed'); } } @@ -185,8 +189,10 @@ const AssignCustProject = ({ openDialog, closeDialog, toggleDialog, idTask, proy
Assign Customer - {proyekName}
- - {renderForm()} + + + {renderForm()} +