import { FluentButton } from "../UI/inputs/buttons/FluentButton.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle, makeStyles } from "@material-ui/core";
//#region src/actions/ActionModal.jsx
const useStyles = makeStyles((theme) => ({}));
const ActionModal = (props) => {
	const $ = c(21);
	const { open, action, title, message: t0, confirmAction: t1, handleOnClose } = props;
	const message = t0 === void 0 ? "Are you sure you want to delete this row?" : t0;
	const confirmAction = t1 === void 0 ? _temp : t1;
	useStyles();
	let t2;
	if ($[0] !== title) {
		t2 = /* @__PURE__ */ React.createElement(DialogTitle, { id: "alert-dialog-title" }, title);
		$[0] = title;
		$[1] = t2;
	} else t2 = $[1];
	let t3;
	if ($[2] !== message) {
		t3 = /* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(DialogContentText, { id: "alert-dialog-description" }, message));
		$[2] = message;
		$[3] = t3;
	} else t3 = $[3];
	let t4;
	if ($[4] !== handleOnClose) {
		t4 = /* @__PURE__ */ React.createElement(FluentButton, {
			onClick: handleOnClose,
			color: "secondary",
			variant: "contained"
		}, "Cancel");
		$[4] = handleOnClose;
		$[5] = t4;
	} else t4 = $[5];
	let t5;
	if ($[6] !== confirmAction || $[7] !== handleOnClose) {
		t5 = () => {
			confirmAction();
			handleOnClose();
		};
		$[6] = confirmAction;
		$[7] = handleOnClose;
		$[8] = t5;
	} else t5 = $[8];
	let t6;
	if ($[9] !== action || $[10] !== t5) {
		t6 = /* @__PURE__ */ React.createElement(FluentButton, {
			onClick: action,
			onMouseUp: t5,
			autoFocus: true,
			variant: "outlined"
		}, "Confirm");
		$[9] = action;
		$[10] = t5;
		$[11] = t6;
	} else t6 = $[11];
	let t7;
	if ($[12] !== t4 || $[13] !== t6) {
		t7 = /* @__PURE__ */ React.createElement(DialogActions, null, t4, t6);
		$[12] = t4;
		$[13] = t6;
		$[14] = t7;
	} else t7 = $[14];
	let t8;
	if ($[15] !== handleOnClose || $[16] !== open || $[17] !== t2 || $[18] !== t3 || $[19] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(Dialog, {
			open,
			onClose: handleOnClose,
			"aria-labelledby": "alert-dialog-title",
			"aria-describedby": "alert-dialog-description"
		}, t2, t3, t7);
		$[15] = handleOnClose;
		$[16] = open;
		$[17] = t2;
		$[18] = t3;
		$[19] = t7;
		$[20] = t8;
	} else t8 = $[20];
	return t8;
};
function _temp() {}
//#endregion
export { ActionModal };

//# sourceMappingURL=ActionModal.mjs.map