forked from ddrilling/asb_cloud_front
Merge branch 'feature/CF2-87-Archive-page-redesign' into dev
This commit is contained in:
commit
2065789404
@ -1,25 +1,29 @@
|
|||||||
import { Progress, Button } from "antd"
|
import { Progress, Button } from 'antd'
|
||||||
import { downloadFile } from "../../components/factory"
|
import { downloadFile } from '../../components/factory'
|
||||||
|
|
||||||
export const ReportCreationNotify = ({progressData}) => {
|
export const ReportCreationNotify = ({ progressData }) => (
|
||||||
progressData = progressData ?? {progress: 0.0, operation: 'Создание отчета'}
|
<>
|
||||||
|
<Progress percent={ Number(progressData.progress?.toFixed(2)) } />
|
||||||
let downloadButton = null
|
<br/>
|
||||||
if (progressData.file)
|
<span>{progressData.operation} стр {progressData.currentPage} из {progressData.totalPages}</span>
|
||||||
downloadButton = <Button
|
{progressData.file && (
|
||||||
type="link"
|
<Button
|
||||||
onClick={_ => {downloadFile(progressData.file)}}
|
type={'link'}
|
||||||
download={progressData.file.name}>
|
onClick={() => {downloadFile(progressData.file)}}
|
||||||
|
download={progressData.file.name}
|
||||||
|
>
|
||||||
{progressData.file.name}
|
{progressData.file.name}
|
||||||
</Button>
|
</Button>
|
||||||
|
)}
|
||||||
const progressText = `${progressData.operation} стр ${progressData.currentPage} из ${progressData.totalPages}`
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Progress percent={ progressData.progress } />
|
|
||||||
<br/>
|
|
||||||
<span>{progressText}</span>
|
|
||||||
{downloadButton}
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
|
ReportCreationNotify.defaultProps = {
|
||||||
|
progressData: {
|
||||||
|
progress: 0.0,
|
||||||
|
operation: 'Создание отчета',
|
||||||
|
currentPage: 0,
|
||||||
|
totalPages: 0,
|
||||||
|
file: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user