import React, { useState } from "react";
import { useHistory } from "react-router-dom";
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 history = useHistory();
const dropdownItems = realmList.map((r) => (
{r}
));
return (
setOpen(!open)}
className={style.toggle}
>
{realm}
}
dropdownItems={[
...dropdownItems,
,
]}
/>
);
};