refactor: batch 1

This commit is contained in:
鲁树人
2025-05-17 05:59:39 +09:00
parent 089d66cbf4
commit 13c669b4ea
23 changed files with 828 additions and 533 deletions

View File

@@ -1,12 +1,15 @@
import type { AnchorHTMLAttributes } from 'react';
import { ExternalLinkIcon } from '@chakra-ui/icons';
import { Link } from '@chakra-ui/react';
import { FiExternalLink } from 'react-icons/fi';
export function ExtLink({ children, ...props }: AnchorHTMLAttributes<HTMLAnchorElement>) {
export type ExtLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
icon?: boolean;
};
export function ExtLink({ className, icon = true, children, ...props }: ExtLinkProps) {
return (
<Link isExternal {...props} rel="noreferrer noopener nofollow">
<a rel="noreferrer noopener nofollow" className={`link ${className}`} {...props}>
{children}
<ExternalLinkIcon />
</Link>
{icon && <FiExternalLink />}
</a>
);
}