summaryrefslogtreecommitdiff
path: root/frontend/src/components/ExternalLink.tsx
blob: a223fc7740c945f958188ac43f3d572a2ab18e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { Navigation } from '@decky/ui';
import { AnchorHTMLAttributes, FC } from 'react';

const ExternalLink: FC<AnchorHTMLAttributes<HTMLAnchorElement>> = (props) => {
  return (
    <a
      {...props}
      onClick={(e) => {
        e.preventDefault();
        props.onClick ? props.onClick(e) : props.href && Navigation.NavigateToExternalWeb(props.href);
      }}
    />
  );
};

export default ExternalLink;