From f861e6a269ba9f62700776d3cd13b644a9e836d4 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Wed, 20 Sep 2023 16:38:54 +0200
Subject: refactor: use named export for everything except pages

Next expect a default export for pages so only those components should
use default exports. Everything else should use named exports to
reduce the number of import statements.
---
 src/components/atoms/layout/sidebar.tsx | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

(limited to 'src/components/atoms/layout/sidebar.tsx')

diff --git a/src/components/atoms/layout/sidebar.tsx b/src/components/atoms/layout/sidebar.tsx
index d86af37..d290069 100644
--- a/src/components/atoms/layout/sidebar.tsx
+++ b/src/components/atoms/layout/sidebar.tsx
@@ -1,19 +1,11 @@
-import { FC, ReactNode } from 'react';
+import { FC, HTMLAttributes, ReactNode } from 'react';
 import styles from './sidebar.module.scss';
 
-export type SidebarProps = {
-  /**
-   * An accessible name for the sidebar.
-   */
-  'aria-label'?: string;
+export type SidebarProps = HTMLAttributes<HTMLElement> & {
   /**
    * The sidebar body.
    */
   children: ReactNode;
-  /**
-   * Set additional classnames to the aside element.
-   */
-  className?: string;
 };
 
 /**
@@ -21,12 +13,14 @@ export type SidebarProps = {
  *
  * Render an aside element.
  */
-const Sidebar: FC<SidebarProps> = ({ children, className = '', ...props }) => {
+export const Sidebar: FC<SidebarProps> = ({
+  children,
+  className = '',
+  ...props
+}) => {
   return (
-    <aside className={`${styles.wrapper} ${className}`} {...props}>
+    <aside {...props} className={`${styles.wrapper} ${className}`}>
       <div className={styles.body}>{children}</div>
     </aside>
   );
 };
-
-export default Sidebar;
-- 
cgit v1.2.3

