import { useSales } from "../../../../../businessModel/SalesModel/Sales/index.js";
import { useStep } from "../../../../Sales/Step/index.js";
import ProgressBar from "../../progressBar/index.js";
import { resourceTitle } from "../../../utils.js";
import React from "react";
import { locales } from "@pisell/utils";
import "./index.less";
//#region src/components/eventBooking/components/Provider/Header/index.tsx
const Header = () => {
	var _steps$currentStepDat, _steps$currentStepDat2;
	const { currentStepData, closePage, prevStep, isFirstStep } = useStep();
	const { removeSessionStorage, data } = useSales();
	/**
	* @title: 步骤数据多语言
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-19 10:36
	*/
	const steps = {
		"select-category": {
			title: locales.getText("pisell2.event.step")(1),
			description: locales.getText("pisell2.event.select.category")(resourceTitle(data))
		},
		"select-event": {
			title: locales.getText("pisell2.event.step")(2),
			description: locales.getText("pisell2.event.select.event")
		},
		"confirm-information": {
			title: locales.getText("pisell2.event.step")(3),
			description: locales.getText("pisell2.event.confirm.information")
		}
	};
	/**
	* @title: 返回
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-18 22:28
	*/
	const handleBack = () => {
		prevStep();
	};
	/**
	* @title: 关闭页面
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-22 13:43
	*/
	const handleClose = () => {
		closePage();
		removeSessionStorage();
	};
	return /* @__PURE__ */ React.createElement(ProgressBar, {
		title: (_steps$currentStepDat = steps[currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]) === null || _steps$currentStepDat === void 0 ? void 0 : _steps$currentStepDat.title,
		description: (_steps$currentStepDat2 = steps[currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]) === null || _steps$currentStepDat2 === void 0 ? void 0 : _steps$currentStepDat2.description,
		showBack: !isFirstStep,
		onBack: () => handleBack(),
		onClose: () => handleClose(),
		className: "event-booking-header"
	});
};
//#endregion
export { Header as default };
