import { useStep } from "../../../../Sales/Step/index.js";
import CartItem from "../Cart/Item/index.js";
import Resource from "../Resource/index.js";
import Event from "../Event/index.js";
import Information from "../Information/index.js";
import React, { useEffect, useMemo } from "react";
import { isMobile } from "@pisell/utils";
import "./index.less";
//#region src/components/eventBooking/components/Provider/Content/index.tsx
const Layout = () => {
	const { currentStepData, isFirstStep } = useStep();
	useEffect(() => {
		window.scrollTo({
			top: 0,
			behavior: "smooth"
		});
	}, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
	const Com = useMemo(() => {
		const key = currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key;
		if (!key) return null;
		let Com = {
			"select-category": Resource,
			"select-event": Event,
			"confirm-information": Information
		}[key];
		return /* @__PURE__ */ React.createElement(Com, null);
	}, [currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key]);
	return /* @__PURE__ */ React.createElement("div", { className: `event-content-wrap ${isMobile() ? "event-content-mobile-wrap" : ""}` }, /* @__PURE__ */ React.createElement("div", { className: "event-content-left" }, Com), !isMobile() && !isFirstStep ? /* @__PURE__ */ React.createElement("div", { className: "event-content-right" }, /* @__PURE__ */ React.createElement(CartItem, null)) : null);
};
//#endregion
export { Layout as default };
