2021-09-23 14:18:46 +05:00
|
|
|
import { Progress, Button } from "antd"
|
2021-09-30 12:33:41 +05:00
|
|
|
import { downloadFile } from "../../components/factory"
|
2021-08-18 10:35:39 +05:00
|
|
|
|
2021-09-23 14:18:46 +05:00
|
|
|
export const ReportCreationNotify = ({progressData}) => {
|
|
|
|
progressData = progressData ?? {progress: 0.0, operation: 'Создание отчета'}
|
2021-08-18 10:35:39 +05:00
|
|
|
|
2021-09-23 14:18:46 +05:00
|
|
|
let downloadButton = null
|
|
|
|
if (progressData.file)
|
|
|
|
downloadButton = <Button
|
|
|
|
type="link"
|
2021-09-30 12:33:41 +05:00
|
|
|
onClick={_ => {downloadFile(progressData.file)}}
|
2021-09-23 14:18:46 +05:00
|
|
|
download={progressData.file.name}>
|
|
|
|
{progressData.file.name}
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
const progressText = `${progressData.operation} стр ${progressData.currentPage} из ${progressData.totalPages}`
|
2021-08-18 10:35:39 +05:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Progress percent={ progressData.progress } />
|
2021-09-23 14:18:46 +05:00
|
|
|
<br/>
|
|
|
|
<span>{progressText}</span>
|
|
|
|
{downloadButton}
|
2021-08-18 10:35:39 +05:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|