"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _designSystem = require("../../design-system");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const Edit = props => {
  const {
    property,
    onChange,
    record
  } = props;
  const value = record.params && record.params[property.name] || '';
  const error = record.errors && record.errors[property.name];
  return _react.default.createElement(_designSystem.FormGroup, {
    error: !!error
  }, _react.default.createElement(_designSystem.Label, {
    htmlFor: property.name
  }, property.label), _react.default.createElement(_designSystem.DatePicker, {
    value: value,
    onChange: data => onChange(property.name, data)
  }), _react.default.createElement(_designSystem.FormMessage, null, error && error.message));
};

var _default = Edit;
exports.default = _default;