From 5c3ea8b577e934237a5d03c477361763b167f57b Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 26 Jan 2022 15:16:59 +0100
Subject: chore: add a Gallery component for MDX rendering

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

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

diff --git a/src/components/MDX/Gallery/Gallery.tsx b/src/components/MDX/Gallery/Gallery.tsx
new file mode 100644
index 0000000..561ec53
--- /dev/null
+++ b/src/components/MDX/Gallery/Gallery.tsx
@@ -0,0 +1,22 @@
+import { Children, ReactElement } from 'react';
+import styles from './Gallery.module.scss';
+
+const Gallery = ({
+  children,
+  columns = 2,
+}: {
+  children: ReactElement;
+  columns: number;
+}) => {
+  const columnClass = styles[`wrapper--${columns}-columns`];
+
+  return (
+    <ul className={`${styles.wrapper} ${columnClass}`}>
+      {Children.map(children, (child) => {
+        return <li className={styles.item}>{child}</li>;
+      })}
+    </ul>
+  );
+};
+
+export default Gallery;
-- 
cgit v1.2.3

