Files
ragflow_python/web/src/components/new-document-link.tsx

29 lines
513 B
TypeScript
Raw Normal View History

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;