import { useCart } from "../../../../Sales/Cart/index.js";
import { useHolder } from "../../../../Sales/Holder/index.js";
import { useSummary } from "../../../../Sales/Summary/index.js";
import SelectHolderModal from "../SelectHolderModal.js";
import ContinueButton from "../Cart/ContinueButton/index.js";
import Cart from "../Cart/index.js";
import Total from "../Cart/Item/Total.js";
import React, { useState } from "react";
import { Badge, Button, Image, SectionFooters } from "@pisell/materials";
import shoppingCartSvg from "../../../assets/shopping-cart.svg";
import "./index.less";
//#region src/components/eventBooking/components/Provider/Footer/index.tsx
const Footer = () => {
	var _cartData$cartItems;
	const { open } = useHolder();
	const { onOpenCart, openCart, onCloseCart, cartData } = useCart();
	const { total } = useSummary();
	const [selectedItem, setSelectedItem] = useState(null);
	return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SectionFooters, {
		className: "section-footer-wrap",
		left: /* @__PURE__ */ React.createElement(Total, {
			className: "section-footer-left",
			isFooter: true
		}),
		right: /* @__PURE__ */ React.createElement("div", { className: "section-footer-right" }, /* @__PURE__ */ React.createElement(Badge, { count: ((_cartData$cartItems = cartData.cartItems) === null || _cartData$cartItems === void 0 ? void 0 : _cartData$cartItems.length) || 0 }, /* @__PURE__ */ React.createElement(Button, {
			size: "large",
			onClick: () => onOpenCart(),
			className: "section-footer-btn"
		}, /* @__PURE__ */ React.createElement(Image, {
			src: shoppingCartSvg,
			preview: false
		}))), /* @__PURE__ */ React.createElement(ContinueButton, null))
	}), /* @__PURE__ */ React.createElement(SelectHolderModal, {
		open,
		selectedItem,
		onSelect: (e) => {
			setSelectedItem(e);
		}
	}), /* @__PURE__ */ React.createElement(Cart, {
		open: openCart,
		onCancel: () => onCloseCart()
	}));
};
//#endregion
export { Footer as default };
