import payLog from "../../utils/payLog.js";
import header_default from "../header/index.js";
import React, { useEffect, useState } from "react";
import { Button, message } from "antd";
import { locales } from "@pisell/utils";
//#region src/components/eftposPay/component/fail/network.tsx
/**
* @title: 断网(客户端)提示页
* @Author: hongbing.wang
* @Date: 2024-08-20 11:40
*/
var network_default = ({ className = "" }) => {
	const [hasBtn, setBtn] = useState(false);
	useEffect(() => {
		payLog.log("断网提示页展示");
		const clear = setTimeout(() => {
			setBtn(true);
		}, 1e3);
		return () => {
			clearTimeout(clear);
		};
	}, []);
	/**
	* @title: 重新连接
	* @description: 只做提示
	* @Author: hongbing.wang
	* @Date: 2024-08-20 11:41
	*/
	const onReconnect = () => {
		payLog.log("断网提示页：点击重新连接");
		message.open({
			key: "net-warning",
			type: "loading",
			content: locales.getText("page.eftpos-pay.text.reconnecting")
		});
	};
	return /* @__PURE__ */ React.createElement("div", { className: `pisell-lowcode__eft-pay-box ${className}` }, /* @__PURE__ */ React.createElement(header_default, { status: "warn" }), /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__eft-pay-fail-title" }, locales.getText("page.eftpos-pay.text.network.disconnected")), /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__eft-pay-warn-text pisell-lowcode__eft-pay-body" }, locales.getText("page.eftpos-pay.text.waiting.wifi.title"), " ", /* @__PURE__ */ React.createElement("br", null), locales.getText("page.eftpos-pay.text.waiting.wifi.connection"), /* @__PURE__ */ React.createElement("br", null), locales.getText("page.eftpos-pay.text.waiting.wifi.router"), /* @__PURE__ */ React.createElement("br", null), locales.getText("page.eftpos-pay.text.waiting.wifi.forget.reconnect")), hasBtn ? /* @__PURE__ */ React.createElement("div", { className: "pisell-lowcode__eft-pay-step-item-btns" }, /* @__PURE__ */ React.createElement(Button, {
		block: true,
		className: "pisell-lowcode__eft-pay-step-item-btn",
		onClick: onReconnect
	}, locales.getText("page.eftpos-pay.text.reconnect.network"))) : null);
};
//#endregion
export { network_default as default };
