From 7e12b2aa7f511e70b727bd865a0b5d0ac6723cb8 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 26 Jan 2022 12:32:30 +0100
Subject: chore: create a Link component for MDX rendering

---
 src/components/MDX/Link/Link.tsx | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 src/components/MDX/Link/Link.tsx

(limited to 'src/components/MDX/Link/Link.tsx')

diff --git a/src/components/MDX/Link/Link.tsx b/src/components/MDX/Link/Link.tsx
new file mode 100644
index 0000000..40e773b
--- /dev/null
+++ b/src/components/MDX/Link/Link.tsx
@@ -0,0 +1,23 @@
+import { ReactChildren } from 'react';
+
+const Link = ({
+  children,
+  target,
+  isExternal = false,
+  lang,
+}: {
+  children: ReactChildren;
+  target: string;
+  isExternal: boolean;
+  lang?: string;
+}) => {
+  const className = isExternal ? 'external' : '';
+
+  return (
+    <a href={target} className={className} hrefLang={lang}>
+      {children}
+    </a>
+  );
+};
+
+export default Link;
-- 
cgit v1.2.3

