aboutsummaryrefslogtreecommitdiff
path: root/src/components/LinkWithIcon.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/LinkWithIcon.tsx')
-rw-r--r--src/components/LinkWithIcon.tsx25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/components/LinkWithIcon.tsx b/src/components/LinkWithIcon.tsx
new file mode 100644
index 0000000..0046125
--- /dev/null
+++ b/src/components/LinkWithIcon.tsx
@@ -0,0 +1,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>
+ );
+}