You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

new-document-link.tsx 537B

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