2021-07-06 11:23:13 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { Button } from 'react-bootstrap';
|
|
|
|
import { formatDateTime } from 'utils/file';
|
|
|
|
import constants from 'utils/strings/constants';
|
|
|
|
import { Label, Row, Value } from './Container';
|
|
|
|
import { ComfySpan } from './ExportInProgress';
|
2021-07-07 07:44:52 +00:00
|
|
|
import { ExportStats } from './ExportModal';
|
2021-07-06 11:23:13 +00:00
|
|
|
import InProgressIcon from './icons/InProgressIcon';
|
|
|
|
|
2021-07-07 07:44:52 +00:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
show: boolean
|
|
|
|
onHide: () => void
|
|
|
|
exportFolder: string
|
|
|
|
exportSize: string
|
|
|
|
lastExportTime: number
|
|
|
|
exportStats: ExportStats
|
|
|
|
updateExportFolder: (newFolder: string) => void;
|
2021-07-12 09:15:08 +00:00
|
|
|
exportFiles: () => void;
|
|
|
|
retryFailed: () => void;
|
2021-07-07 07:44:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function ExportFinished(props: Props) {
|
2021-07-06 11:23:13 +00:00
|
|
|
return (
|
2021-07-07 09:20:59 +00:00
|
|
|
<>
|
2021-07-06 11:23:13 +00:00
|
|
|
<div style={{ borderBottom: '1px solid #444', marginBottom: '20px', padding: '0 5%' }}>
|
|
|
|
<Row>
|
|
|
|
<Label width="40%">{constants.LAST_EXPORT_TIME}</Label>
|
2021-07-07 07:44:52 +00:00
|
|
|
<Value width="60%">{formatDateTime(props.lastExportTime)}</Value>
|
2021-07-06 11:23:13 +00:00
|
|
|
</Row>
|
|
|
|
<Row>
|
|
|
|
<Label width="60%">{constants.SUCCESSFULLY_EXPORTED_FILES}</Label>
|
2021-07-07 07:44:52 +00:00
|
|
|
<Value width="35%"><ComfySpan>{props.exportStats.total - props.exportStats.failed} / {props.exportStats.total}</ComfySpan></Value>
|
2021-07-06 11:23:13 +00:00
|
|
|
</Row>
|
|
|
|
<Row>
|
|
|
|
<Label width="60%">{constants.FAILED_EXPORTED_FILES}</Label>
|
|
|
|
<Value width="35%">
|
2021-07-07 07:44:52 +00:00
|
|
|
<ComfySpan>{props.exportStats.failed} / {props.exportStats.total}</ComfySpan>
|
2021-07-06 11:23:13 +00:00
|
|
|
</Value>
|
2021-07-07 07:44:52 +00:00
|
|
|
{props.exportStats.failed !== 0 &&
|
|
|
|
<Value width="5%">
|
2021-07-12 12:05:29 +00:00
|
|
|
<InProgressIcon disabled onClick={props.retryFailed} />
|
2021-07-07 07:44:52 +00:00
|
|
|
</Value>
|
|
|
|
}
|
2021-07-06 11:23:13 +00:00
|
|
|
</Row>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '100%', display: 'flex', justifyContent: 'space-around' }}>
|
2021-07-07 07:44:52 +00:00
|
|
|
<Button block variant={'outline-secondary'} onClick={props.onHide}>{constants.CLOSE}</Button>
|
2021-07-06 11:23:13 +00:00
|
|
|
<div style={{ width: '30px' }} />
|
2021-07-12 09:15:08 +00:00
|
|
|
<Button block variant={'outline-success'} onClick={props.exportFiles}>{constants.EXPORT_AGAIN}</Button>
|
2021-07-06 11:23:13 +00:00
|
|
|
</div>
|
2021-07-07 09:20:59 +00:00
|
|
|
</>
|
2021-07-06 11:23:13 +00:00
|
|
|
);
|
|
|
|
}
|