import { validateI18nRequired } from "../../../../model/types.js";
import React from "react";
import { Form } from "antd";
import { BaseTranslation, Icon, Select as Select$1 } from "@pisell/materials";
//#region src/plus/saasDevice/devicePlanning/modules/deviceConnections/components/connectDeviceModal/NewPeripheralInfoFields.tsx
const validateRequired = (message) => [{
	required: true,
	message
}];
const NewPeripheralInfoFields = ({ workAreas, workAreaId, currentWorkAreaId, getText, translation }) => /* @__PURE__ */ React.createElement("div", { className: "device-detail-drawer__connect-new-info" }, /* @__PURE__ */ React.createElement("div", { className: "device-detail-drawer__connect-section-title" }, /* @__PURE__ */ React.createElement(Icon, { type: "InfoCircleOutlined" }), getText("pisell2.saas.device-planning.connect.new-info")), /* @__PURE__ */ React.createElement("div", { style: { height: "8px" } }), /* @__PURE__ */ React.createElement(Form.Item, {
	name: "name",
	label: getText("pisell2.saas.device-planning.add.device-name"),
	required: true,
	rules: [{ validator: validateI18nRequired(getText("pisell2.saas.device-planning.add.device-name-required")) }]
}, /* @__PURE__ */ React.createElement(BaseTranslation, { renderMode: "edit" })), /* @__PURE__ */ React.createElement(Form.Item, {
	name: "workarea_id",
	label: getText("pisell2.saas.device-planning.edit.work-area"),
	required: true,
	rules: validateRequired(getText("pisell2.saas.device-planning.edit.work-area-required"))
}, /* @__PURE__ */ React.createElement(Select$1, {
	value: workAreaId,
	options: workAreas.map((area) => ({
		label: `${translation(area.name) || area.id}${area.id === currentWorkAreaId ? ` (${getText("pisell2.saas.device-planning.connect.current")})` : ""}`,
		value: area.id
	}))
})));
//#endregion
export { NewPeripheralInfoFields as default };
