import React, { useContext, useState } from "react"; import { useTranslation } from "react-i18next"; import { Avatar, Brand, Dropdown, DropdownItem, DropdownSeparator, DropdownToggle, KebabToggle, PageHeader, PageHeaderTools, PageHeaderToolsItem, PageHeaderToolsGroup, } from "@patternfly/react-core"; import { HelpIcon } from "@patternfly/react-icons"; import { KeycloakContext } from "./auth/KeycloakContext"; import { HelpHeader } from "./components/help-enabler/HelpHeader"; import { Link } from "react-router-dom"; export const Header = () => { return ( } logoComponent="div" headerTools={headerTools()} /> ); }; const ManageAccountDropdownItem = () => { const keycloak = useContext(KeycloakContext); const { t } = useTranslation(); return ( keycloak?.account()}> {t("manageAccount")} ); }; const SignOutDropdownItem = () => { const keycloak = useContext(KeycloakContext); const { t } = useTranslation(); return ( keycloak?.logout()}> {t("signOut")} ); }; const ServerInfoDropdownItem = () => { const { t } = useTranslation(); return {t("serverInfo")}; }; const HelpDropdownItem = () => { const { t } = useTranslation(); return }>{t("help")}; }; const kebabDropdownItems = [ , , , , , ]; const userDropdownItems = [ , , , , ]; const headerTools = () => { return ( ); }; const KebabDropdown = () => { const [isDropdownOpen, setDropdownOpen] = useState(false); const onDropdownToggle = () => { setDropdownOpen(!isDropdownOpen); }; return ( } isOpen={isDropdownOpen} dropdownItems={kebabDropdownItems} /> ); }; const UserDropdown = () => { const keycloak = useContext(KeycloakContext); const [isDropdownOpen, setDropdownOpen] = useState(false); const onDropdownToggle = () => { setDropdownOpen(!isDropdownOpen); }; return ( {keycloak?.loggedInUser} } dropdownItems={userDropdownItems} /> ); };