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

32 lines
1.1 KiB
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-25 07:33:26 +00:00
import constants from 'utils/strings/constants'
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 ? (
2021-01-25 07:33:26 +00:00
<Alert variant='success'>{constants.UPLOAD[3]}</Alert>
) : (
2021-01-12 06:59:37 +00:00
<>
2021-01-25 07:33:26 +00:00
<Alert variant='info'>{constants.UPLOAD[uploadStage]} {fileCounter?.total != 0 ? `${fileCounter?.current} ${constants.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
}