import { Avatar, Brand, Dropdown, DropdownItem, DropdownSeparator, DropdownToggle, KebabToggle, PageHeader, PageHeaderTools, PageHeaderToolsGroup, PageHeaderToolsItem, } from "@patternfly/react-core"; import { HelpIcon } from "@patternfly/react-icons"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { HelpHeader, useHelp } from "./components/help-enabler/HelpHeader"; import { useAdminClient } from "./context/auth/AdminClient"; import { useRealm } from "./context/realm-context/RealmContext"; import { useWhoAmI } from "./context/whoami/WhoAmI"; import { toDashboard } from "./dashboard/routes/Dashboard"; import environment from "./environment"; export const Header = () => { const { realm } = useRealm(); const { keycloak } = useAdminClient(); const { t } = useTranslation(); const ManageAccountDropdownItem = () => ( keycloak.accountManagement()} > {t("manageAccount")} ); const SignOutDropdownItem = () => ( keycloak.logout({ redirectUri: "" })} > {t("signOut")} ); const ServerInfoDropdownItem = () => { const { realm } = useRealm(); const { t } = useTranslation(); return ( ( )} > {t("realmInfo")} ); }; const HelpDropdownItem = () => { const { t } = useTranslation(); const { enabled, toggleHelp } = useHelp(); return ( } onClick={toggleHelp}> {enabled ? t("helpEnabled") : t("helpDisabled")} ); }; const kebabDropdownItems = [ , , , , , ]; const userDropdownItems = [ , , , , ]; const headerTools = () => { return ( ); }; 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} /> ); }; return (