import { Divider } from '@rocket.chat/fuselage'; import { Fragment, memo } from 'react'; import { useTranslation } from 'react-i18next'; import SidebarNavigationItem from './SidebarNavigationItem'; import type { SidebarItem } from '../../lib/createSidebarItems'; import { isSidebarItem } from '../../lib/createSidebarItems'; export type SidebarItemsAssemblerProps = { items: SidebarItem[]; currentPath?: string; }; const SidebarItemsAssembler = ({ items, currentPath }: SidebarItemsAssemblerProps) => { const { t, i18n } = useTranslation(); return ( <> {items.map((props) => ( {isSidebarItem(props) ? ( [0])} currentPath={currentPath} tag={props.tag && i18n.exists(props.tag) ? t(props.tag) : props.tag} externalUrl={props.externalUrl} badge={props.badge} /> ) : ( )} ))} ); }; export default memo(SidebarItemsAssembler);