29 lines
733 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 = BaseElementProps<string> & {
text: string;
};
export default function Link({ value, status, text, ...props }: ElementProps) {
return (
<AntButton
rel="noopener"
target="_blank"
href={value}
disabled={status === 'Disabled'}
loading={status === 'Loading'}
icon={<DownloadOutlined />}
{...props}
>
{text}
</AntButton>
);
}
type LinkProps = BaseButtonProps & Pick<ElementProps, 'text'>;
export type { LinkProps };