import { JSONSchema } from "json-schema-typed" import { JSVOptions } from "../../contexts" import Translate from "@docusaurus/Translate" import type { JSX } from "react" type Props = { schema: Exclude options: JSVOptions nullable?: boolean } export default function UnsolvedRefsQM(props: Props): JSX.Element { const { schema, options: { UnresolvedRefsComponent }, } = props // Translated label const unsolvedRefLabel = ( {"Unsolved ref(s) :"} ) // Unsolved ref(s) // Technically speak, nothing prevents people to combine $ref / $dynamicRef / $recursiveRef / .. // So generic approach instead let unsolvedRefValue: string = [ schema.$ref, schema.$dynamicRef, (schema as any).$recursiveRef, ] .filter((s) => s !== undefined) .join(" ") return (
{UnresolvedRefsComponent ? ( ) : ( <> {unsolvedRefLabel}   {unsolvedRefValue} )}
) }