blob: 0046125cd22e8cf267c25fc865d37a119d79a9b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import ExternalLinkIcon from "./ExternalLink";
export default function LinkWithIcon({
href,
children,
className = 'inline-flex items-center gap-1 underline text-blue-400',
target = '_blank',
}: {
href: string;
children: React.ReactNode;
className?: string;
target?: React.HTMLAttributeAnchorTarget;
}) {
return (
<a
href={href}
target={target}
rel={target === '_blank' ? 'noopener noreferrer' : undefined}
className={className}
>
{children}
<ExternalLinkIcon />
</a>
);
}
|