import { t as e } from "../../../button-BNOmhdpM.js";
import { a as t, i as n, n as r, o as i, r as a, t as o } from "../../../popover-Ck3ILBUA.js";
import { useState as s } from "react";
import { jsx as c, jsxs as l } from "react/jsx-runtime";
//#region lib/components/ui/molecules/confirm-popover.tsx
function u({ title: u, description: d, confirmLabel: f = "Confirm", cancelLabel: p = "Cancel", confirmVariant: m = "destructive", onConfirm: h, children: g, side: _ = "bottom" }) {
	let [v, y] = s(!1);
	return /* @__PURE__ */ l(o, {
		onOpenChange: y,
		open: v,
		children: [/* @__PURE__ */ c(i, { render: g }), /* @__PURE__ */ l(r, {
			className: "w-auto max-w-64 gap-3 p-4",
			side: _,
			children: [/* @__PURE__ */ l(n, { children: [/* @__PURE__ */ c(t, { children: u }), d && /* @__PURE__ */ c(a, { children: d })] }), /* @__PURE__ */ l("div", {
				className: "flex justify-end gap-2",
				children: [/* @__PURE__ */ c(e, {
					"data-testid": "confirm-popover-cancel",
					onClick: () => y(!1),
					size: "sm",
					variant: "outline",
					children: p
				}), /* @__PURE__ */ c(e, {
					"data-testid": "confirm-popover-confirm",
					onClick: () => {
						h(), y(!1);
					},
					size: "sm",
					variant: m,
					children: f
				})]
			})]
		})]
	});
}
//#endregion
export { u as ConfirmPopover };
