import React, { ReactNode, VFC } from 'react'; import { Link } from 'react-router-dom'; import { Divider, Drawer, List } from '@mui/material'; import GitHubIcon from '@mui/icons-material/GitHub'; import LibraryBooksIcon from '@mui/icons-material/LibraryBooks'; import ExitToApp from '@mui/icons-material/ExitToApp'; import { ReactComponent as LogoIcon } from 'assets/icons/logoBg.svg'; import NavigationLink from '../NavigationLink/NavigationLink'; import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender'; import { basePath } from 'utils/formatPath'; import { IFlags } from 'interfaces/uiConfig'; import { IRoute } from 'interfaces/route'; import styles from './DrawerMenu.module.scss'; // FIXME: useStyle - theme interface IDrawerMenuProps { title?: string; open?: boolean; toggleDrawer: () => void; admin?: boolean; links: Array<{ value: string; icon: string | ReactNode; href: string; title: string; }>; flags?: IFlags; routes: { mainNavRoutes: IRoute[]; mobileRoutes: IRoute[]; adminRoutes: IRoute[]; }; } export const DrawerMenu: VFC = ({ links = [], title = 'Unleash', flags = {}, open = false, toggleDrawer, admin = false, routes, }) => { const renderLinks = () => { return links.map(link => { let icon = null; if (link.value === 'GitHub') { icon = ; } else if (link.value === 'Documentation') { icon = ; } return ( {icon} {link.value} ); }); }; return ( ); };