import CustomFormItem from "./form/index.js";
import { Eftpos, getDefaultValue } from "./const.js";
import React from "react";
import { Button, Form } from "antd";
import { locales } from "@pisell/utils";
//#region src/components/eftpos/device.tsx
const Device = (props) => {
	const { onSave, children, formItemList } = props;
	const initialValues = getDefaultValue(formItemList);
	return /* @__PURE__ */ React.createElement(React.Fragment, null, (props === null || props === void 0 ? void 0 : props.type) === Eftpos.MX51 && /* @__PURE__ */ React.createElement("div", {
		className: "pisell-lowcode__pos-device-pair-text",
		style: {
			display: "flex",
			flexDirection: "column"
		}
	}, /* @__PURE__ */ React.createElement("span", null, "1. On the terminal: Go to \"Manage POS pairing\" and create a new POS pairing."), /* @__PURE__ */ React.createElement("span", null, "2. On the terminal: Select \"Simple Cloud Integration\"."), /* @__PURE__ */ React.createElement("span", null, "3. Enter the pairing code provided from the terminal"), /* @__PURE__ */ React.createElement("span", null, "4. Create a pairing nickname for the terminal to identify."), /* @__PURE__ */ React.createElement("span", null, "5. Tap \"Pair\" to initiate the pairing on both devices.")), /* @__PURE__ */ React.createElement(Form, {
		layout: "vertical",
		onFinish: onSave,
		initialValues,
		className: "pisell-lowcode__pos-device"
	}, /* @__PURE__ */ React.createElement("div", { style: {
		flex: 1,
		overflow: "auto",
		padding: "0 0 60px 0"
	} }, /* @__PURE__ */ React.createElement(CustomFormItem, { formItemList }), children), /* @__PURE__ */ React.createElement(Form.Item, { className: "pisell-lowcode__pos-device-btn" }, /* @__PURE__ */ React.createElement(Button, {
		htmlType: "submit",
		block: true,
		style: { height: "48px" }
	}, (props === null || props === void 0 ? void 0 : props.status) === "edit" ? locales.getText("page.eftpos.text.save") : locales.getText("page.eftpos.text.pair")))));
};
//#endregion
export { Device as default };
