2022-05-24 11:47:17 +03:00

34 lines
727 B
TypeScript

import DownloadOutlined from '@ant-design/icons/lib/icons/DownloadOutlined';
import { Button as AntButton } from 'antd';
import type { BaseButtonProps } from 'antd/lib/button/button';
import type { BaseElementProps } from './types';
type ElementProps = {
text: string;
};
export default function Link({
value,
status,
text,
...props
}: BaseElementProps<string> & ElementProps) {
return (
<AntButton
rel="noopener"
target="_blank"
href={value}
disabled={status === 'Disabled'}
loading={status === 'Loading'}
icon={<DownloadOutlined />}
{...props}
>
{text}
</AntButton>
);
}
type LinkProps = BaseButtonProps & ElementProps;
export type { LinkProps };