import { faPlus as plusIcon, faServer as serverIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Link } from 'react-router-dom'; import { DropdownItem, DropdownMenu, DropdownToggle, UncontrolledDropdown } from 'reactstrap'; import type { SelectedServer, ServersMap } from './data'; import { getServerId } from './data'; export interface ServersDropdownProps { servers: ServersMap; selectedServer: SelectedServer; } export const ServersDropdown = ({ servers, selectedServer }: ServersDropdownProps) => { const serversList = Object.values(servers); const renderServers = () => { if (serversList.length === 0) { return ( Add a server ); } return ( <> {serversList.map(({ name, id }) => ( {name} ))} Manage servers ); }; return ( Servers {renderServers()} ); };