import { cx as e } from "../../theme/tools.js";
import { Modal as t } from "../../atomic/atoms/modal/Modal.js";
import { modalBody as n, modalImage as r, previewButton as i, previewImage as a } from "./imagePreviewModal.css.js";
import { useState as o } from "react";
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
//#region src/components/media/ImagePreviewModal.tsx
var u = ({ src: u, alt: d, title: f, previewSize: p = "md", className: m }) => {
	let [h, g] = o(!1), _ = f ?? d;
	return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("button", {
		type: "button",
		className: e(i({ size: p }), m),
		onClick: () => {
			g(!0);
		},
		"aria-label": _,
		children: /* @__PURE__ */ c("img", {
			src: u,
			alt: d,
			className: a,
			loading: "lazy"
		})
	}), /* @__PURE__ */ c(t, {
		isOpen: h,
		onClose: () => {
			g(!1);
		},
		title: _,
		initialFocus: "dialog",
		children: /* @__PURE__ */ c("div", {
			className: n,
			children: /* @__PURE__ */ c("img", {
				src: u,
				alt: d,
				className: r
			})
		})
	})] });
};
//#endregion
export { u as ImagePreviewModal, u as default };

//# sourceMappingURL=ImagePreviewModal.js.map