const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../hooks/useEngineContext.js");
const require_locales = require("./locales.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/plus/contactInfoModal/ContactInfoContent.tsx
const ContactInfoContent = (props) => {
	var _context$appHelper$ut, _config$first_name, _config$first_name2, _config$last_name, _config$last_name2, _config$phone, _config$phone2, _config$email, _config$email2;
	const context = require_useEngineContext.default();
	_pisell_utils.locales.init(require_locales.default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
	const { config, form } = props;
	console.log("config", config);
	return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-contact-info-modal-content" }, /* @__PURE__ */ react.default.createElement(antd.Form, {
		size: "large",
		layout: "vertical",
		form
	}, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-contact-info-modal-content-name-wrap" }, (config === null || config === void 0 || (_config$first_name = config.first_name) === null || _config$first_name === void 0 ? void 0 : _config$first_name.visible) !== false ? /* @__PURE__ */ react.default.createElement(_pisell_materials.FormItemInput, {
		renderMode: "edit",
		label: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.first-name"),
		placeholder: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.first-name-placeholder"),
		name: "first_name",
		requiredobj: {
			required: (config === null || config === void 0 || (_config$first_name2 = config.first_name) === null || _config$first_name2 === void 0 ? void 0 : _config$first_name2.required) !== true ? false : true,
			message: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.first-name-required")
		}
	}) : null, (config === null || config === void 0 || (_config$last_name = config.last_name) === null || _config$last_name === void 0 ? void 0 : _config$last_name.visible) !== false ? /* @__PURE__ */ react.default.createElement(_pisell_materials.FormItemInput, {
		renderMode: "edit",
		label: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.last-name"),
		placeholder: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.last-name-placeholder"),
		name: "last_name",
		requiredobj: {
			required: (config === null || config === void 0 || (_config$last_name2 = config.last_name) === null || _config$last_name2 === void 0 ? void 0 : _config$last_name2.required) !== true ? false : true,
			message: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.last-name-required")
		}
	}) : null), (config === null || config === void 0 || (_config$phone = config.phone) === null || _config$phone === void 0 ? void 0 : _config$phone.visible) !== false ? /* @__PURE__ */ react.default.createElement(_pisell_materials.FormItemInput.Mobile, {
		renderMode: "edit",
		name: "phone",
		label: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.mobile"),
		placeholder: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.mobile-placeholder"),
		typeobj: {
			type: "phone",
			enabled: true,
			message: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.mobile-error")
		},
		requiredobj: {
			required: (config === null || config === void 0 || (_config$phone2 = config.phone) === null || _config$phone2 === void 0 ? void 0 : _config$phone2.required) !== true ? false : true,
			message: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.mobile-required")
		},
		returnFormat: "object"
	}) : null, (config === null || config === void 0 || (_config$email = config.email) === null || _config$email === void 0 ? void 0 : _config$email.visible) !== false ? /* @__PURE__ */ react.default.createElement(_pisell_materials.FormItemInput.Email, {
		renderMode: "edit",
		name: "email",
		label: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.email"),
		placeholder: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.email-placeholder"),
		typeobj: {
			type: "email",
			enabled: true
		},
		requiredobj: {
			required: (config === null || config === void 0 || (_config$email2 = config.email) === null || _config$email2 === void 0 ? void 0 : _config$email2.required) !== true ? false : true,
			message: _pisell_utils.locales.getText("pisell2.text.contact-info.modal.email-required")
		},
		onChange: () => {
			form.validateFields(["email"]);
		}
	}) : null));
};
//#endregion
exports.default = ContactInfoContent;
