import { SideSheet } from "../../surfaces/SideSheet.mjs";
import { handleDownloadFile } from "../utils/fileUtils.mjs";
import { Image } from "./Image.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { useTranslation } from "react-i18next";
//#region src/UI/fileViewer/imageSlider/ImageViewerSideSheet.jsx
const ImageViewerSideSheet = (props) => {
	const $ = c(21);
	const { title, width, imageObj, open, onClose, hideDownload, hidePrimaryText, hideSecondaryText } = props;
	const { t } = useTranslation();
	let t0;
	if ($[0] !== imageObj?.fileName || $[1] !== imageObj?.filePath) {
		t0 = () => {
			handleDownloadFile(imageObj?.filePath, imageObj?.fileName);
		};
		$[0] = imageObj?.fileName;
		$[1] = imageObj?.filePath;
		$[2] = t0;
	} else t0 = $[2];
	const handleDownloadImage = t0;
	let t1;
	if ($[3] !== t || $[4] !== title) {
		t1 = title ?? t("Image Viewer");
		$[3] = t;
		$[4] = title;
		$[5] = t1;
	} else t1 = $[5];
	let t2;
	if ($[6] !== hideDownload || $[7] !== t) {
		t2 = hideDownload ? null : t("Download");
		$[6] = hideDownload;
		$[7] = t;
		$[8] = t2;
	} else t2 = $[8];
	const t3 = width ?? "90vw";
	let t4;
	if ($[9] !== hidePrimaryText || $[10] !== hideSecondaryText || $[11] !== imageObj) {
		t4 = /* @__PURE__ */ React.createElement(Image, {
			imageObj,
			hidePrimaryText,
			hideSecondaryText
		});
		$[9] = hidePrimaryText;
		$[10] = hideSecondaryText;
		$[11] = imageObj;
		$[12] = t4;
	} else t4 = $[12];
	let t5;
	if ($[13] !== handleDownloadImage || $[14] !== onClose || $[15] !== open || $[16] !== t1 || $[17] !== t2 || $[18] !== t3 || $[19] !== t4) {
		t5 = /* @__PURE__ */ React.createElement(SideSheet, {
			title: t1,
			buttonLabel: t2,
			width: t3,
			onSubmit: handleDownloadImage,
			open,
			onClose,
			contentHeight: "100%"
		}, t4);
		$[13] = handleDownloadImage;
		$[14] = onClose;
		$[15] = open;
		$[16] = t1;
		$[17] = t2;
		$[18] = t3;
		$[19] = t4;
		$[20] = t5;
	} else t5 = $[20];
	return t5;
};
//#endregion
export { ImageViewerSideSheet };

//# sourceMappingURL=ImageViewerSideSheet.mjs.map