const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/components/scanOrder/components/Header/index.tsx
const STEP_TEXTS = {
	init: {
		index: 1,
		localeKey: "pisell2.scan.order.step.init",
		fallback: "Initialize"
	},
	product: {
		index: 2,
		localeKey: "pisell2.scan.order.step.product",
		fallback: "Select product"
	},
	check: {
		index: 3,
		localeKey: "pisell2.scan.order.step.check",
		fallback: "Check order"
	},
	error: {
		index: 4,
		localeKey: "pisell2.scan.order.step.error",
		fallback: "Unavailable"
	}
};
function Header(props) {
	const { currentStep, onBack } = props;
	const stepText = (0, react.useMemo)(() => {
		const value = _pisell_utils.locales.getText("pisell2.appointment.step");
		if (typeof value === "function") return value(STEP_TEXTS[currentStep].index);
		console.log("stepText", currentStep);
		return `Step ${STEP_TEXTS[currentStep].index}`;
	}, [currentStep]);
	const title = (0, react.useMemo)(() => {
		const text = _pisell_utils.locales.getText(STEP_TEXTS[currentStep].localeKey);
		if (typeof text === "string" && text) return text;
		return STEP_TEXTS[currentStep].fallback;
	}, [currentStep]);
	return /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellHeaderProgressBar, {
		className: "pisell-scan-order-progress-bar",
		stepText,
		title,
		showClose: false,
		showBack: currentStep !== "init",
		onBack,
		enableBorder: true,
		borderColor: "#EAECF0"
	});
}
//#endregion
exports.default = Header;
