File size: 537 Bytes
8e222fd 8d2a400 b0b89da 8d2a400 8e222fd b0b89da 8d2a400 b0b89da 8d2a400 b0b89da 8e222fd b0b89da 8d2a400 8e222fd cb33b9e 8e222fd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import React from 'react';
interface IProps extends React.PropsWithChildren {
link: string;
preventDefault?: boolean;
color?: string;
}
const NewDocumentLink = ({
children,
link,
preventDefault = false,
color = 'rgb(15, 79, 170)',
}: IProps) => {
return (
<a
target="_blank"
onClick={!preventDefault ? undefined : (e) => e.preventDefault()}
href={link}
rel="noreferrer"
style={{ color, wordBreak: 'break-all' }}
>
{children}
</a>
);
};
export default NewDocumentLink;
|