mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-09 09:23:51 +00:00
305d6b6476
* chore: update documentation links * fix: sentry has no access to error context * style: clarify event history * fix: issue with clipboard write in safari * style: clarify event history * refactor: improvements to follow logic in rundown * refactor: improvements in go mode * several style tweaks and small improvements
30 lines
793 B
TypeScript
30 lines
793 B
TypeScript
import { MouseEvent, ReactNode } from 'react';
|
|
import { IoOpenOutline } from '@react-icons/all-files/io5/IoOpenOutline';
|
|
|
|
import { openLink } from '../../common/utils/linkUtils';
|
|
import { cx } from '../../common/utils/styleUtils';
|
|
|
|
import style from './ModalLink.module.scss';
|
|
|
|
interface ModalLinkProps {
|
|
href: string;
|
|
children: ReactNode;
|
|
inline?: boolean;
|
|
}
|
|
|
|
export default function ModalLink(props: ModalLinkProps) {
|
|
const { href, inline, children } = props;
|
|
const classes = cx([style.link, inline ? style.inline : null]);
|
|
|
|
const handleClick = (event: MouseEvent) => {
|
|
event.preventDefault();
|
|
openLink(href);
|
|
};
|
|
|
|
return (
|
|
<a href='#!' target='_blank' rel='noreferrer' className={classes} onClick={handleClick}>
|
|
{children} <IoOpenOutline />
|
|
</a>
|
|
);
|
|
}
|