import { Avatar, Brand, Dropdown, DropdownItem, DropdownSeparator, DropdownToggle, KebabToggle, PageHeader, PageHeaderTools, PageHeaderToolsGroup, PageHeaderToolsItem, } from "@patternfly/react-core"; import { HelpIcon } from "@patternfly/react-icons"; import { ReactNode, useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { useHelp } from "ui-shared"; import { HelpHeader } from "./components/help-enabler/HelpHeader"; import { useRealm } from "./context/realm-context/RealmContext"; import { useWhoAmI } from "./context/whoami/WhoAmI"; import { toDashboard } from "./dashboard/routes/Dashboard"; import environment from "./environment"; import { keycloak } from "./keycloak"; const ManageAccountDropdownItem = () => { const { t } = useTranslation(); return ( keycloak.accountManagement()} > {t("manageAccount")} ); }; const SignOutDropdownItem = () => { const { t } = useTranslation(); return ( keycloak.logout({ redirectUri: "" })} > {t("signOut")} ); }; const ServerInfoDropdownItem = () => { const { realm } = useRealm(); const { t } = useTranslation(); return ( ( )) as unknown as ReactNode } > {t("realmInfo")} ); }; const HelpDropdownItem = () => { const { t } = useTranslation(); const { enabled, toggleHelp } = useHelp(); return ( } onClick={toggleHelp}> {enabled ? t("helpEnabled") : t("helpDisabled")} ); }; const kebabDropdownItems = [ , , , , , ]; const userDropdownItems = [ , , , , ]; const KebabDropdown = () => { const [isDropdownOpen, setDropdownOpen] = useState(false); return ( } isOpen={isDropdownOpen} dropdownItems={kebabDropdownItems} /> ); }; const UserDropdown = () => { const { whoAmI } = useWhoAmI(); const [isDropdownOpen, setDropdownOpen] = useState(false); return ( {whoAmI.getDisplayName()} } dropdownItems={userDropdownItems} /> ); }; export const Header = () => { const { realm } = useRealm(); const headerTools = () => { const picture = keycloak.tokenParsed?.picture; return ( ); }; return (