"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.BasicsSection = void 0;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _designSystem = require("@wix/design-system");
var _fieldTypeUtils = require("../fieldTypeUtils");
var _FieldTypeSelect = require("../formFields/FieldTypeSelect");
var _FieldNameInput = require("../formFields/FieldNameInput");
var _FieldPiiToggle = require("../formFields/FieldPiiToggle");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CmsFieldManagement/Sections/BasicsSection.tsx";
const _BasicsSection = ({
  state
}) => {
  const {
    properties,
    visibleErrors,
    mode
  } = state;
  return /*#__PURE__*/_react.default.createElement(_designSystem.Box, {
    direction: "vertical",
    gap: "SP4",
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 18,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_FieldTypeSelect.FieldTypeSelect, {
    label: "Field type",
    value: properties.type,
    onChange: state.changeType,
    disabled: mode === 'edit',
    error: visibleErrors.type,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 19,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_FieldNameInput.FieldNameInput, {
    label: "Field name",
    value: properties.name,
    onChange: state.changeName,
    onBlur: () => state.blurField('name'),
    error: visibleErrors.name,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 27,
      columnNumber: 7
    }
  }), (0, _fieldTypeUtils.isPIISupportedByFieldType)(properties.type) && /*#__PURE__*/_react.default.createElement(_FieldPiiToggle.FieldPiiToggle, {
    label: "Personal information (PII)",
    checked: properties.isPii,
    onChange: state.setIsPii,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 36,
      columnNumber: 9
    }
  }));
};
const BasicsSection = exports.BasicsSection = (0, _mobxReactLite.observer)(_BasicsSection);
//# sourceMappingURL=BasicsSection.js.map