Files
um-react/src/components/ExtLink.tsx
2025-10-15 00:57:56 +09:00

16 lines
533 B
TypeScript

import type { AnchorHTMLAttributes, ReactNode } from 'react';
import { FiExternalLink } from 'react-icons/fi';
export type ExtLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
icon?: boolean | ReactNode;
};
export function ExtLink({ className, icon = true, children, ...props }: ExtLinkProps) {
return (
<a rel="noreferrer noopener nofollow" target="_blank" className={`link ${className}`} {...props}>
{children}
{icon === true ? <FiExternalLink className="inline size-sm ml-1" /> : icon}
</a>
);
}