diff --git a/gui/src/pages/config/AccountManagement.tsx b/gui/src/pages/config/AccountManagement.tsx new file mode 100644 index 000000000..95214278b --- /dev/null +++ b/gui/src/pages/config/AccountManagement.tsx @@ -0,0 +1,160 @@ +import { Listbox, Transition } from "@headlessui/react"; +import { + ArrowTopRightOnSquareIcon, + ChevronUpDownIcon, + PlusCircleIcon, +} from "@heroicons/react/24/outline"; +import { Fragment, useContext, useEffect, useState } from "react"; +import AssistantIcon from "../../components/modelSelection/platform/AssistantIcon"; +import { useAuth } from "../../context/Auth"; +import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { useNavigationListener } from "../../hooks/useNavigationListener"; +import { useAppDispatch } from "../../redux/hooks"; +import { selectProfileThunk } from "../../redux/thunks/profileAndOrg"; +import { ScopeSelect } from "./ScopeSelect"; + +export function AccountManagement() { + useNavigationListener(); + const dispatch = useAppDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + + const { session, login, profiles, selectedProfile, selectedOrganization } = + useAuth(); + + const changeProfileId = (id: string) => { + dispatch(selectProfileThunk(id)); + }; + + const [hubEnabled, setHubEnabled] = useState(false); + + useEffect(() => { + ideMessenger.ide.getIdeSettings().then(({ continueTestEnvironment }) => { + setHubEnabled(continueTestEnvironment === "production"); + }); + }, [ideMessenger]); + + function handleOpenConfig() { + if (!selectedProfile) { + return; + } + ideMessenger.post("config/openProfile", { + profileId: selectedProfile.id, + }); + } + + return ( +