This commit is contained in:
1 parent
c1541b80df
commit
b4c7908029
97 files changed
+12403
-154
No files matched your search
@@ -0,0 +1,30 @@
|
||||
import type { AnchorHTMLAttributes } from "react";
|
||||
import {
|
||||
buttonClassName,
|
||||
type ButtonStyleOptions,
|
||||
} from "./button-variants";
|
||||
|
||||
export type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &
|
||||
ButtonStyleOptions;
|
||||
|
||||
/**
|
||||
* 外链按钮:用于邮件、社交链接等外部地址。
|
||||
* 站内跳转请使用 next-intl 的 <Link> 并传入 buttonClassName()。
|
||||
*/
|
||||
export function ButtonLink({
|
||||
className,
|
||||
variant,
|
||||
size,
|
||||
rel = "noopener noreferrer",
|
||||
target = "_blank",
|
||||
...props
|
||||
}: ButtonLinkProps) {
|
||||
return (
|
||||
<a
|
||||
rel={rel}
|
||||
target={target}
|
||||
className={buttonClassName({ className, variant, size })}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user