import React, { useState } from 'react'; import { Dropdown, DropdownToggle, DropdownItem, Button, } from '@patternfly/react-core'; import style from './realm-selector.module.css'; type RealmSelectorProps = { realm: string; realmList: string[]; }; export const RealmSelector = ({ realm, realmList }: RealmSelectorProps) => { const [open, setOpen] = useState(false); const dropdownItems = realmList.map((r) => ( {r} )); return ( setOpen(!open)} className={style.toggle} > {realm} } dropdownItems={[ ...dropdownItems, , ]} /> ); };