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

Loading…
Cancel
Save