import CompensatedPisellContainer from "../../../../../pro/compensatedPisellContainer/index.js";
import withResponsive from "../../../../../responsive/withResponsive.js";
import React, { forwardRef, useImperativeHandle, useState } from "react";
import { Button } from "antd";
import { locales } from "@pisell/utils";
//#region src/components/booking/components/footer/AppointmentProductModal/index.tsx
const AppointmentProductModal = (props, ref) => {
	const { variant } = props;
	const [open, setOpen] = useState(false);
	const isPhoneVariant = variant === "phone";
	useImperativeHandle(ref, () => ({ open: () => {
		setOpen(true);
	} }));
	return /* @__PURE__ */ React.createElement(CompensatedPisellContainer, {
		renderType: isPhoneVariant ? "drawer" : "modal",
		props: isPhoneVariant ? {
			open,
			placement: "bottom",
			width: "100%",
			height: "auto",
			title: locales.getText("pisell2.text.missing.reservation.title"),
			onClose: () => setOpen(false),
			footer: /* @__PURE__ */ React.createElement("div", { style: {
				display: "flex",
				gap: 12
			} }, /* @__PURE__ */ React.createElement(Button, {
				style: { flex: 1 },
				onClick: () => setOpen(false)
			}, locales.getText("pisell2.text.cancel")), /* @__PURE__ */ React.createElement(Button, {
				style: { flex: 1 },
				type: "primary",
				onClick: () => setOpen(false)
			}, locales.getText("pisell2.text.confirm")))
		} : {
			open,
			platform: "pc",
			title: locales.getText("pisell2.text.missing.reservation.title"),
			onCancel: () => setOpen(false),
			footer: /* @__PURE__ */ React.createElement("div", { style: {
				display: "flex",
				justifyContent: "flex-end",
				gap: 8
			} }, /* @__PURE__ */ React.createElement(Button, { onClick: () => setOpen(false) }, locales.getText("pisell2.text.cancel")), /* @__PURE__ */ React.createElement(Button, {
				type: "primary",
				onClick: () => setOpen(false)
			}, locales.getText("pisell2.text.confirm"))),
			closable: true
		}
	}, /* @__PURE__ */ React.createElement("div", null, locales.getText("pisell2.text.missing.reservation.content")));
};
const ForwardedAppointmentProductModal = forwardRef(AppointmentProductModal);
ForwardedAppointmentProductModal.displayName = "AppointmentProductModal";
var AppointmentProductModal_default = withResponsive(ForwardedAppointmentProductModal);
//#endregion
export { AppointmentProductModal_default as default };
