Browse Source

add loader

pull/1/head
wahyuun 1 year ago
parent
commit
cd29f3de52
  1. 7
      src/views/SimproV2/CreatedProyek/DialogDocument.js

7
src/views/SimproV2/CreatedProyek/DialogDocument.js

@ -1,7 +1,7 @@
import React, { useEffect, useState, useMemo } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Button } from 'reactstrap';
import { Table, Tooltip, Popover } from 'antd';
import { Table, Tooltip, Popover, Spin } from 'antd';
import 'antd/dist/antd.css';
import moment from 'moment';
import SweetAlert from 'react-bootstrap-sweetalert';
@ -33,6 +33,7 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
const [idDelete, setIdDelete] = useState(0)
const [dataEdit, setDataEdit] = useState(null)
const [parentIdNewFolder, setParentIdNewFolder] = useState(0)
const [loading, setLoading] = useState(true);
useEffect(() => {
if (idTask > 0) {
@ -61,7 +62,9 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
.catch((error) => error.response);
if (result && result.data && result.data.code == 200) {
setDataDocument(result.data.data);
setLoading(false);
} else {
setLoading(false);
NotificationManager.error('Gagal mengambil data, Silahkan coba lagi!!', 'Failed');
}
}
@ -279,9 +282,11 @@ const DialogDocument = ({ openDialog, closeDialog, toggleDialog, idTask, proyekN
{/* <Button onClick={openDialogRequest} size='sm' color="primary"><i className='fa fa-folder'></i></Button> */}
</ModalHeader>
<ModalBody>
<Spin tip="Loading..." spinning={loading}>
<div style={{ width: '100%', overflow: "auto" }}>
{RenderTable}
</div>
</Spin>
</ModalBody>
{/* <ModalFooter>
<Button className="capitalize" color="secondary" onClick={() => handleCancel()}>Batal</Button>

Loading…
Cancel
Save