ente/src/pages/gallery/components/UploadProgress.tsx

31 lines
1,010 B
TypeScript
Raw Normal View History

2021-01-05 11:12:02 +00:00
import React from 'react';
import { Alert, Modal, ProgressBar } from 'react-bootstrap';
2021-01-05 11:12:02 +00:00
2021-01-12 14:29:38 +00:00
export default function UploadProgress({ fileCounter, uploadStage, now, ...props }) {
return (
<Modal
{...props}
size='lg'
aria-labelledby='contained-modal-title-vcenter'
centered
backdrop="static"
>
<Modal.Header>
<Modal.Title id='contained-modal-title-vcenter'>
Uploading Files
2021-01-05 11:12:02 +00:00
</Modal.Title>
</Modal.Header>
<Modal.Body>
{now === 100 ? (
<Alert variant='success'>Upload Completed</Alert>
) : (
2021-01-12 06:59:37 +00:00
<>
<Alert variant='info'>{uploadStage} {fileCounter?.current} of {fileCounter?.total}</Alert>
2021-01-12 14:29:38 +00:00
<ProgressBar animated now={now} />
2021-01-12 06:59:37 +00:00
</>
)}
</Modal.Body>
</Modal>
);
2021-01-05 11:12:02 +00:00
}