/* * Vencord, a Discord client mod * Copyright (c) 2025 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import "./Link.css"; import { classes } from "@utils/misc"; import type { AnchorHTMLAttributes, DetailedHTMLProps, PropsWithChildren } from "react"; export interface LinkProps extends DetailedHTMLProps, HTMLAnchorElement> { disabled?: boolean; useDefaultUnderlineStyles?: boolean; } export function Link({ disabled, useDefaultUnderlineStyles = true, href, rel, target, className, children, ...restProps }: PropsWithChildren) { const isInternal = href && /^(?:discord:\/)?\/[a-zA-Z0-9_-]/.test(href); const needsSafeAttrs = href && !isInternal; return ( {children} ); }