import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["content", "type"];
import { defineMessage } from 'react-intl';
import extendType from './_extendType';
import _dummy from './_dummy';
import { Typography } from '@material-ui/core';
import { jsx as _jsx } from "react/jsx-runtime";
export var TitleField = function TitleField(_ref) {
  var _uiSchema$uiOptions, _uiSchema$uiOptions$e, _idSchema$$id;

  var idSchema = _ref.idSchema,
      uiSchema = _ref.uiSchema;
  var content = uiSchema === null || uiSchema === void 0 ? void 0 : (_uiSchema$uiOptions = uiSchema['ui:options']) === null || _uiSchema$uiOptions === void 0 ? void 0 : (_uiSchema$uiOptions$e = _uiSchema$uiOptions.element) === null || _uiSchema$uiOptions$e === void 0 ? void 0 : _uiSchema$uiOptions$e.content;
  var headerNumber = (idSchema === null || idSchema === void 0 ? void 0 : (_idSchema$$id = idSchema.$id) === null || _idSchema$$id === void 0 ? void 0 : _idSchema$$id.split('_').length) + 1;
  return /*#__PURE__*/_jsx(Typography, {
    component: headerNumber < 5 ? "h".concat(headerNumber) : 'h6',
    variant: "h5",
    children: content
  });
};
export default extendType(_dummy, function (_ref2) {
  var _ref2$config = _ref2.config,
      content = _ref2$config.content,
      type = _ref2$config.type,
      other = _objectWithoutProperties(_ref2$config, _excluded);

  return function (props) {
    var _props$uiSchema;

    props.schema.additionalType = type;
    (_props$uiSchema = props.uiSchema) !== null && _props$uiSchema !== void 0 ? _props$uiSchema : props.uiSchema = {};
    props.uiSchema['ui:field'] = TitleField;
    props.uiSchema['ui:should-update'] = content;
  };
});
export var name = defineMessage({
  id: "ZFehpA",
  defaultMessage: [{
    "type": 0,
    "value": "Otsikko"
  }]
});
export var elementType = 'element';
//# sourceMappingURL=title.js.map