feat: add corresponding icons to files (#164)

This commit is contained in:
balibabu
2024-03-28 16:18:16 +08:00
committed by GitHub
parent a5384446e3
commit b6837d4ca6
13 changed files with 137 additions and 55 deletions

View File

@ -3,12 +3,18 @@ import React from 'react';
interface IProps extends React.PropsWithChildren {
documentId: string;
preventDefault?: boolean;
}
const NewDocumentLink = ({ children, documentId }: IProps) => {
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"
>