import { Typography as Typography$1 } from "../../dataDisplay/typography/Typography.mjs";
import { getIconFromName } from "../../../utilities/tree/TreeUtilities.mjs";
import { IconButtonWithTooltip } from "../../inputs/buttons/IconButtonWithToolTip.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { makeStyles } from "@material-ui/core";
import { useTranslation } from "react-i18next";
//#region src/UI/fileViewer/imageSlider/ImageFooter.jsx
const useStyles = makeStyles((theme) => ({
	secondaryText: { color: theme.palette.text.secondary },
	description: {
		margin: theme.spacing(2),
		display: "flex",
		flexDirection: "column",
		gap: theme.spacing(1)
	},
	pageAction: {
		display: "flex",
		justifyContent: "space-between",
		gap: theme.spacing(1),
		alignItems: "center"
	}
}));
const ImageFooter = (props) => {
	const $ = c(19);
	const { images, currentImageObj, hidePrimaryText, hideSecondaryText, handleViewImage, currentImageIndex } = props;
	const classes = useStyles();
	const { t } = useTranslation();
	const showPrimaryText = !hidePrimaryText && currentImageObj?.primaryText;
	const showSecondaryText = !hideSecondaryText && currentImageObj?.secondaryText;
	const showPageAction = images?.length > 1;
	const t0 = showPageAction || showPrimaryText || showSecondaryText;
	let t1;
	if ($[0] !== showPageAction || $[1] !== showPrimaryText || $[2] !== showSecondaryText || $[3] !== t0) {
		t1 = {
			footer: t0,
			primaryText: showPrimaryText,
			secondaryText: showSecondaryText,
			pageAction: showPageAction
		};
		$[0] = showPageAction;
		$[1] = showPrimaryText;
		$[2] = showSecondaryText;
		$[3] = t0;
		$[4] = t1;
	} else t1 = $[4];
	const showItem = t1;
	let t2;
	if ($[5] !== classes || $[6] !== currentImageIndex || $[7] !== currentImageObj?.primaryText || $[8] !== currentImageObj?.secondaryText || $[9] !== handleViewImage || $[10] !== images?.length || $[11] !== showItem?.footer || $[12] !== showItem?.pageAction || $[13] !== showItem?.primaryText || $[14] !== showItem?.secondaryText || $[15] !== t) {
		t2 = showItem?.footer && /* @__PURE__ */ React.createElement("div", { className: classes.description }, showItem?.primaryText && /* @__PURE__ */ React.createElement(Typography$1, { variant: "h6" }, currentImageObj?.primaryText), showItem?.secondaryText && /* @__PURE__ */ React.createElement(Typography$1, {
			variant: "subtitle1",
			className: classes.secondaryText
		}, currentImageObj?.secondaryText), showItem?.pageAction && /* @__PURE__ */ React.createElement("div", { className: classes.pageAction }, /* @__PURE__ */ React.createElement(IconButtonWithTooltip, {
			icon: getIconFromName("ChevronLeft"),
			title: t("Previous"),
			disabled: currentImageIndex == 0,
			onClick: () => {
				handleViewImage(true);
			},
			id: "udpRecord-ImageSlider-PreviousBtn",
			udprecordid: "udpRecord-ImageSlider-PreviousBtn"
		}), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Typography$1, null, currentImageIndex + 1, " ", t("of"), " ", images?.length ?? 0)), /* @__PURE__ */ React.createElement(IconButtonWithTooltip, {
			icon: getIconFromName("ChevronRight"),
			title: t("Next"),
			disabled: currentImageIndex === images?.length - 1,
			onClick: () => {
				handleViewImage();
			},
			id: "udpRecord-ImageSlider-NextBtn",
			udprecordid: "udpRecord-ImageSlider-NextBtn"
		})));
		$[5] = classes;
		$[6] = currentImageIndex;
		$[7] = currentImageObj?.primaryText;
		$[8] = currentImageObj?.secondaryText;
		$[9] = handleViewImage;
		$[10] = images?.length;
		$[11] = showItem?.footer;
		$[12] = showItem?.pageAction;
		$[13] = showItem?.primaryText;
		$[14] = showItem?.secondaryText;
		$[15] = t;
		$[16] = t2;
	} else t2 = $[16];
	let t3;
	if ($[17] !== t2) {
		t3 = /* @__PURE__ */ React.createElement(React.Fragment, null, t2);
		$[17] = t2;
		$[18] = t3;
	} else t3 = $[18];
	return t3;
};
//#endregion
export { ImageFooter };

//# sourceMappingURL=ImageFooter.mjs.map