/* ============================================================================ * Copyright (c) Palo Alto Networks * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * ========================================================================== */ import React from "react"; import { translate } from "@docusaurus/Translate"; import FormItem from "@theme/ApiExplorer/FormItem"; import FormSelect from "@theme/ApiExplorer/FormSelect"; import FormTextInput from "@theme/ApiExplorer/FormTextInput"; import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks"; import { OPENAPI_AUTH } from "@theme/translationIds"; import { setAuthData, setSelectedAuth } from "./slice"; function Authorization() { const data = useTypedSelector((state: any) => state.auth.data); const options = useTypedSelector((state: any) => state.auth.options); const selected = useTypedSelector((state: any) => state.auth.selected); const dispatch = useTypedDispatch(); if (selected === undefined) { return null; } const selectedAuth = options[selected]; const optionKeys = Object.keys(options); return (