File size: 529 Bytes
8e222fd
 
 
 
 
b0b89da
8e222fd
 
b0b89da
 
 
 
 
8e222fd
 
 
b0b89da
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
import { api_host } from '@/utils/api';
import React from 'react';

interface IProps extends React.PropsWithChildren {
  documentId: string;
  preventDefault?: boolean;
}

const NewDocumentLink = ({
  children,
  documentId,
  preventDefault = false,
}: IProps) => {
  return (
    <a
      target="_blank"
      onClick={!preventDefault ? undefined : (e) => e.preventDefault()}
      href={`${api_host}/document/get/${documentId}`}
      rel="noreferrer"
    >
      {children}
    </a>
  );
};

export default NewDocumentLink;