import { FluentButton } from "../../../../UI/inputs/buttons/FluentButton.mjs";
import { useTransactionEngine } from "../../../../utilities/transactions/useTransactionEngine.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { useTranslation } from "react-i18next";
import "./EditTransactionDetailsFooterItem.css";
//#region src/udp/pages/UdpTransactionsPage/components/EditTransactionDetailsFooterItem.jsx
const EditTransactionDetailsFooterItem = (props) => {
	const $ = c(13);
	const { transactionTypeId, transactionIsClosed, handleOnCancel, handleOnSaveChanges, hideSaveChanges } = props;
	useTransactionEngine(transactionTypeId);
	const { t } = useTranslation();
	let t0;
	if ($[0] !== t) {
		t0 = t("Cancel");
		$[0] = t;
		$[1] = t0;
	} else t0 = $[1];
	let t1;
	if ($[2] !== handleOnCancel || $[3] !== t0) {
		t1 = /* @__PURE__ */ React.createElement(FluentButton, {
			color: "primary",
			onClick: handleOnCancel
		}, t0);
		$[2] = handleOnCancel;
		$[3] = t0;
		$[4] = t1;
	} else t1 = $[4];
	let t2;
	if ($[5] !== handleOnSaveChanges || $[6] !== hideSaveChanges || $[7] !== t || $[8] !== transactionIsClosed) {
		t2 = !transactionIsClosed && !hideSaveChanges && /* @__PURE__ */ React.createElement(FluentButton, {
			variant: "contained",
			color: "primary",
			onClick: handleOnSaveChanges
		}, t("Save Changes"));
		$[5] = handleOnSaveChanges;
		$[6] = hideSaveChanges;
		$[7] = t;
		$[8] = transactionIsClosed;
		$[9] = t2;
	} else t2 = $[9];
	let t3;
	if ($[10] !== t1 || $[11] !== t2) {
		t3 = /* @__PURE__ */ React.createElement("div", { className: "transaction-details-footer-item" }, t1, t2);
		$[10] = t1;
		$[11] = t2;
		$[12] = t3;
	} else t3 = $[12];
	return t3;
};
//#endregion
export { EditTransactionDetailsFooterItem as default };

//# sourceMappingURL=EditTransactionDetailsFooterItem.mjs.map