import { faList as listIcon, faLink as createIcon, faTags as tagsIcon, faPen as editIcon, faHome as overviewIcon, faGlobe as domainsIcon, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { FC } from 'react'; import { NavLink, NavLinkProps } from 'react-router-dom'; import classNames from 'classnames'; import { Location } from 'history'; import { DeleteServerButtonProps } from '../servers/DeleteServerButton'; import { isServerWithId, SelectedServer } from '../servers/data'; import { supportsDomainRedirects } from '../utils/helpers/features'; import './AsideMenu.scss'; export interface AsideMenuProps { selectedServer: SelectedServer; className?: string; showOnMobile?: boolean; } interface AsideMenuItemProps extends NavLinkProps { to: string; } const AsideMenuItem: FC = ({ children, to, className, ...rest }) => ( {children} ); const AsideMenu = (DeleteServerButton: FC) => ( { selectedServer, showOnMobile = false }: AsideMenuProps, ) => { const serverId = isServerWithId(selectedServer) ? selectedServer.id : ''; const addManageDomainsLink = supportsDomainRedirects(selectedServer); const asideClass = classNames('aside-menu', { 'aside-menu--hidden': !showOnMobile, }); const shortUrlsIsActive = (_: null, location: Location) => location.pathname.match('/list-short-urls') !== null; const buildPath = (suffix: string) => `/server/${serverId}${suffix}`; return ( ); }; export default AsideMenu;