vchikalkin 7b9dbdaeb5 add turborepo
move ./Elements to packages/elements
2022-12-19 19:08:32 +03:00

31 lines
651 B
TypeScript

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