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, useLocation } from 'react-router-dom'; import classNames from 'classnames'; 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; showOnMobile?: boolean; } interface AsideMenuItemProps extends NavLinkProps { to: string; } const AsideMenuItem: FC = ({ children, to, className, ...rest }) => ( classNames('aside-menu__item', className, { 'aside-menu__item--selected': isActive })} to={to} {...rest} > {children} ); export const AsideMenu = (DeleteServerButton: FC) => ( { selectedServer, showOnMobile = false }: AsideMenuProps, ) => { const hasId = isServerWithId(selectedServer); const serverId = hasId ? selectedServer.id : ''; const { pathname } = useLocation(); const addManageDomainsLink = supportsDomainRedirects(selectedServer); const asideClass = classNames('aside-menu', { 'aside-menu--hidden': !showOnMobile, }); const buildPath = (suffix: string) => `/server/${serverId}${suffix}`; return ( ); };