import type { FC, ReactNode } from 'react'; import { Link, List, ListItem, Nav, type NavProps } from '../../atoms'; import { NavLink } from './nav-link'; import styles from './nav-list.module.scss'; export type NavItem = { /** * The item id. */ id: string; /** * The item link. */ href: string; /** * The item name. */ label: string; /** * The item logo. */ logo?: ReactNode; }; export type NavListProps = Omit & { /** * The navigation items. */ items: NavItem[]; /** * The navigation kind. */ kind: 'main' | 'footer'; /** * Set additional classnames to the navigation list. */ listClassName?: string; }; /** * Nav component * * Render the nav links. */ export const NavList: FC = ({ className = '', items, kind, listClassName = '', ...props }) => { const navClass = [styles[`nav--${kind}`], className].join(' '); /** * Get the nav items. * @returns {JSX.Element[]} An array of nav items. */ const getItems = (): JSX.Element[] => items.map(({ id, href, label, logo }) => ( {kind === 'main' ? ( ) : ( {label} )} )); return ( ); };