import { useAppointmentBookingContext } from "../../../context.js";
import React from "react";
import { locales } from "@pisell/utils";
import { PisellText } from "@pisell/materials";
import classNames from "classnames";
import "./index.less";
//#region src/components/appointmentBooking/components/Cart/Item/Total.tsx
const Total = ({ className, isFooter }) => {
	const { summary, symbolic } = useAppointmentBookingContext();
	const { taxTitle, totalTaxFee, isPriceIncludeTax, total, deposit } = summary;
	return /* @__PURE__ */ React.createElement("div", { className: `appointment-total-wrap ${className} ${(deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) ? "appointment-total-deposit-wrap" : ""}` }, !isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ React.createElement("div", { className: "gst-wrap" }, /* @__PURE__ */ React.createElement("span", null, taxTitle, isFooter ? ": " : ""), /* @__PURE__ */ React.createElement(PisellText.Amount, {
		value: totalTaxFee,
		showCurrencySymbol: true
	})) : null, /* @__PURE__ */ React.createElement("div", { className: classNames("event-total", { [["total-gst-wrap"]]: !isPriceIncludeTax && Number(totalTaxFee) > 0 }) }, /* @__PURE__ */ React.createElement("div", { className: "left" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("span", null, (deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) && isFooter ? locales.getText("pisell2.appointment.deposit") : locales.getText("pisell2.event.total"), isFooter ? ": " : ""), isFooter ? /* @__PURE__ */ React.createElement(PisellText.Amount, {
		value: (deposit === null || deposit === void 0 ? void 0 : deposit.hasDeposit) ? deposit === null || deposit === void 0 ? void 0 : deposit.total : total,
		showCurrencySymbol: true,
		className: "event-amount"
	}) : null), isPriceIncludeTax && Number(totalTaxFee) > 0 ? /* @__PURE__ */ React.createElement("span", { className: "gst" }, locales.getText("pisell2.event.total.gst")(`${isFooter ? `${taxTitle}: ` : taxTitle}`, `${symbolic}${totalTaxFee}`)) : null), !isFooter ? /* @__PURE__ */ React.createElement(PisellText.Amount, {
		value: total,
		showCurrencySymbol: true,
		className: "event-amount"
	}) : null));
};
//#endregion
export { Total as default };
