import React from 'react';
import { Form } from 'antd';
import { BaseTranslation } from '@pisell/materials';
import { validateI18nRequired } from "../../types";
var I18nNameFormItem = function I18nNameFormItem(_ref) {
  var name = _ref.name,
    label = _ref.label,
    requiredMessage = _ref.requiredMessage,
    placeholder = _ref.placeholder,
    textarea = _ref.textarea;
  return /*#__PURE__*/React.createElement(Form.Item, {
    name: name,
    label: label,
    required: Boolean(requiredMessage),
    rules: requiredMessage ? [{
      validator: validateI18nRequired(requiredMessage)
    }] : undefined
  }, /*#__PURE__*/React.createElement(BaseTranslation, {
    allowClear: true,
    renderMode: "edit",
    type: textarea ? 'textarea' : undefined,
    placeholder: placeholder
  }));
};
export default I18nNameFormItem;