asb_cloud_front/src/pages/Report/ReportCreationNotify.jsx

31 lines
766 B
React
Raw Normal View History

import { Progress, Button } from 'antd'
import { downloadFile } from '@components/factory'
2021-08-18 10:35:39 +05:00
export const ReportCreationNotify = ({ progressData }) => (
<>
<Progress percent={ Number(progressData.progress?.toFixed(2)) } />
<br/>
<span>{progressData.operation} стр {progressData.currentPage} из {progressData.totalPages}</span>
{progressData.file && (
<Button
type={'link'}
onClick={() => {downloadFile(progressData.file)}}
download={progressData.file.name}
>
2021-09-23 14:18:46 +05:00
{progressData.file.name}
</Button>
)}
2021-08-18 10:35:39 +05:00
</>
)
ReportCreationNotify.defaultProps = {
progressData: {
progress: 0.0,
operation: 'Создание отчета',
currentPage: 0,
totalPages: 0,
file: null
}
}