21 lines
475 B
JavaScript
21 lines
475 B
JavaScript
import { Button as AntButton } from 'antd';
|
|
import { ElementStatus } from 'core/types/statuses';
|
|
import React from 'react';
|
|
|
|
const Download = ({ status, url, text, icon: Icon, ...props }) => {
|
|
return (
|
|
<AntButton
|
|
{...props}
|
|
target="_blank"
|
|
href={url}
|
|
disabled={status === ElementStatus.Disabled || !url}
|
|
loading={status === ElementStatus.Loading}
|
|
icon={<Icon />}
|
|
>
|
|
{text}
|
|
</AntButton>
|
|
);
|
|
};
|
|
|
|
export default Download;
|