/* ============================================================================ * 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, { type JSX, useEffect, useState } from "react"; import { usePrismTheme } from "@docusaurus/theme-common"; import { translate } from "@docusaurus/Translate"; import useIsBrowser from "@docusaurus/useIsBrowser"; import { ErrorMessage } from "@hookform/error-message"; import { OPENAPI_FORM } from "@theme/translationIds"; import clsx from "clsx"; import { Controller, useFormContext } from "react-hook-form"; import { LiveProvider, LiveEditor, withLive } from "react-live"; function Live({ onEdit, showErrors }: any) { const isBrowser = useIsBrowser(); const [editorDisabled, setEditorDisabled] = useState(false); return (