From c6f6f8f895e68f2d85ca681997ef613d982bac14 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 20 Oct 2023 14:06:48 +0200
Subject: refactor(components): rewrite NavList component

* extract NavItem from NavList
* remove `kind` and `listClassName` props (since the consumer has
control over NavList, NavItem and NavLink components these props are
obsolete)
---
 src/components/molecules/nav/nav-item/nav-item.tsx | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 src/components/molecules/nav/nav-item/nav-item.tsx

(limited to 'src/components/molecules/nav/nav-item/nav-item.tsx')

diff --git a/src/components/molecules/nav/nav-item/nav-item.tsx b/src/components/molecules/nav/nav-item/nav-item.tsx
new file mode 100644
index 0000000..2e85043
--- /dev/null
+++ b/src/components/molecules/nav/nav-item/nav-item.tsx
@@ -0,0 +1,24 @@
+import {
+  type ForwardRefRenderFunction,
+  forwardRef,
+  type ReactNode,
+} from 'react';
+import { ListItem, type ListItemProps } from '../../../atoms';
+
+export type NavItemProps = Omit<ListItemProps, 'children' | 'hideMarker'> & {
+  /**
+   * The nav item contents.
+   */
+  children: ReactNode;
+};
+
+const NavItemWithRef: ForwardRefRenderFunction<HTMLLIElement, NavItemProps> = (
+  { children, ...props },
+  ref
+) => (
+  <ListItem {...props} hideMarker ref={ref}>
+    {children}
+  </ListItem>
+);
+
+export const NavItem = forwardRef(NavItemWithRef);
-- 
cgit v1.2.3

