Equicord/src/components/Link.tsx

30 lines
793 B
TypeScript
Raw Normal View History

2022-10-22 01:17:06 +02:00
/*
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
2022-10-22 01:17:06 +02:00
import "./Link.css";
2022-10-01 00:42:50 +02:00
import { classes } from "@utils/misc";
import type { AnchorHTMLAttributes, PropsWithChildren } from "react";
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
2022-10-01 00:42:50 +02:00
disabled?: boolean;
}
export function Link({ disabled, className, children, ...restProps }: PropsWithChildren<LinkProps>) {
2022-10-01 00:42:50 +02:00
return (
<a
role="link"
target="_blank"
rel="noreferrer noopener"
className={classes("vc-link", disabled && "vc-link-disabled", className)}
aria-disabled={disabled}
{...restProps}
>
{children}
2022-10-01 00:42:50 +02:00
</a>
);
}