From fb29b0f017fae162ffa7ad6bdfc80099346802de Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Mon, 13 Nov 2023 19:03:44 +0100
Subject: refactor(components): replace SocialMedia with SocialMediaWidget

* the goal is to make the name of the widgets coherent
* remove useless CSS
* replace Media type with SocialMediaData
---
 src/components/organisms/widgets/social-media.tsx | 40 -----------------------
 1 file changed, 40 deletions(-)
 delete mode 100644 src/components/organisms/widgets/social-media.tsx

(limited to 'src/components/organisms/widgets/social-media.tsx')

diff --git a/src/components/organisms/widgets/social-media.tsx b/src/components/organisms/widgets/social-media.tsx
deleted file mode 100644
index 14c8fe6..0000000
--- a/src/components/organisms/widgets/social-media.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import type { FC } from 'react';
-import { List, ListItem, SocialLink, type SocialLinkProps } from '../../atoms';
-import { Collapsible, type CollapsibleProps } from '../../molecules';
-import styles from './social-media.module.scss';
-
-export type Media = Required<
-  Pick<SocialLinkProps, 'icon' | 'id' | 'label' | 'url'>
->;
-
-export type SocialMediaProps = Omit<CollapsibleProps, 'children'> & {
-  media: Media[];
-};
-
-/**
- * Social Media widget component
- *
- * Render a social media list with links.
- */
-export const SocialMedia: FC<SocialMediaProps> = ({ media, ...props }) => {
-  /**
-   * Retrieve the social media items.
-   *
-   * @param {SocialMedia[]} links - An array of social media name and url.
-   * @returns {JSX.Element[]} The social links.
-   */
-  const getItems = (links: Media[]): JSX.Element[] =>
-    links.map(({ id, ...link }) => (
-      <ListItem key={id}>
-        <SocialLink {...link} />
-      </ListItem>
-    ));
-
-  return (
-    <Collapsible {...props}>
-      <List className={styles.list} hideMarker isInline spacing="xs">
-        {getItems(media)}
-      </List>
-    </Collapsible>
-  );
-};
-- 
cgit v1.2.3

