import Base_default from "../../../../plus/saleDetail/Base.js";
import BigSaleFloatButtons from "../../components/FloatButtons/index.js";
import { BigSaleProductList } from "../../components/ProductList/index.js";
import TimeBar_default from "../../components/TimeBar/index.js";
import React, { useState } from "react";
import { Iconfont } from "@pisell/materials";
//#region src/components/bigSale/templates/Standard/index.tsx
function pickSaleDetailDataSource(dataSource) {
	return {
		sales: dataSource.sales,
		customer: dataSource.customer,
		cart: dataSource.cart,
		summary: dataSource.summary
	};
}
/**
* 标准模板：商品列表与订单详情共同展示。
*/
function StandardBigSaleTemplate({ dataSource, mode, variant, productLoadParams, productDisplayConfig, saleDetailTemplate, saleDetailModuleConfig, orderId, locale }) {
	const [timeBarDrawerOpen, setTimeBarDrawerOpen] = useState(false);
	const isPhone = variant === "phone";
	return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("section", { className: "pisell-big-sale__product-panel" }, /* @__PURE__ */ React.createElement(BigSaleProductList, {
		mode,
		dataSource,
		productLoadParams,
		productDisplayConfig,
		variant
	}), isPhone && /* @__PURE__ */ React.createElement(BigSaleFloatButtons, { items: [{
		icon: /* @__PURE__ */ React.createElement(Iconfont, { type: "pisell2-clock" }),
		key: "time-bar",
		onClick: () => setTimeBarDrawerOpen(true)
	}] })), /* @__PURE__ */ React.createElement("section", { className: "pisell-big-sale__sale-detail" }, /* @__PURE__ */ React.createElement(Base_default, {
		dataSource: pickSaleDetailDataSource(dataSource),
		renderType: "current",
		template: saleDetailTemplate,
		variant,
		mobilePresentation: "bottomSheet",
		moduleConfig: saleDetailModuleConfig
	})), /* @__PURE__ */ React.createElement(TimeBar_default, {
		dataSource,
		productLoadParams,
		orderId,
		locale,
		variant,
		mobileDrawerOpen: timeBarDrawerOpen,
		onMobileDrawerClose: () => setTimeBarDrawerOpen(false)
	}));
}
//#endregion
export { StandardBigSaleTemplate };
