import { Link as RouterLink } from '@tanstack/react-router'; import classNames from 'classnames'; import type { HTMLAttributes } from 'react'; import { appInfo } from '../../lib/appInfo'; import { Icon } from './Icon'; interface Props extends HTMLAttributes { href: string; noUnderline?: boolean; } export function Link({ href, children, noUnderline, className, ...other }: Props) { const isExternal = href.match(/^https?:\/\//); className = classNames(className, 'relative'); if (isExternal) { let finalHref = href; if (href.startsWith('https://yaak.app')) { const url = new URL(href); url.searchParams.set('ref', appInfo.identifier); finalHref = url.toString(); } return ( { e.preventDefault(); }} {...other} > {children} ); } return ( {children} ); } export function FeedbackLink() { return Feedback; }