import React from "react";
import { getDefaultRegistry } from "@rjsf/core";
import { CodeEditor } from "../widgets/code-editor";
import { renderDescription, renderTitle } from "../templates/common";
import { isCustomObjectSchema } from "./field-helpers";
const { fields: defaultFields } = getDefaultRegistry();
const BaseObjectField = defaultFields.ObjectField;
export class ObjectField extends React.Component {
    render() {
        if (!isCustomObjectSchema(this.props.schema)) {
            return React.createElement(BaseObjectField, this.props);
        }
        return React.createElement(React.Fragment, {}, renderTitle(this.props.schema.title), renderDescription(this.props.schema.description), React.createElement(CodeEditor, this.props));
    }
}
