### What problem does this PR solve? fix: fix uploaded file time error #680 feat: support preview of word and excel #684 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
29 lines
513 B
TypeScript
29 lines
513 B
TypeScript
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 }}
|
|
>
|
|
{children}
|
|
</a>
|
|
);
|
|
};
|
|
|
|
export default NewDocumentLink;
|