2022-10-22 01:17:06 +02:00
|
|
|
/*
|
2025-12-07 21:28:03 +01: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
|
|
|
|
2025-12-07 21:28:03 +01:00
|
|
|
import "./Link.css";
|
2022-10-01 00:42:50 +02:00
|
|
|
|
2025-12-07 21:28:03 +01: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;
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-07 21:28:03 +01:00
|
|
|
export function Link({ disabled, className, children, ...restProps }: PropsWithChildren<LinkProps>) {
|
2022-10-01 00:42:50 +02:00
|
|
|
return (
|
2025-12-07 21:28:03 +01:00
|
|
|
<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>
|
|
|
|
|
);
|
|
|
|
|
}
|