"use client";
import { jsxs as w, Fragment as x, jsx as o } from "react/jsx-runtime";
import { generateImageUrl as g } from "../../../utils/index.js";
import t from "../../../assets/images/placeholder.png.js";
const I = ({ settings: l, meta: a }) => {
  var e, c, m, d, n, h, p, f, k;
  const u = (a == null ? void 0 : a.locale) || "en", i = (c = (e = l.caption) == null ? void 0 : e.text) == null ? void 0 : c[u], r = /* @__PURE__ */ w(x, { children: [
    /* @__PURE__ */ o(
      "img",
      {
        width: ((m = l.media) == null ? void 0 : m.width) ?? 500,
        height: ((d = l.media) == null ? void 0 : d.height) ?? 500,
        src: (n = l.media) != null && n.path ? g(l.media.path) : ((h = l.media) == null ? void 0 : h.url) ?? t,
        alt: ((p = l.media) == null ? void 0 : p.name) ?? "image"
      }
    ),
    i && /* @__PURE__ */ o("figcaption", { className: "block-img-caption", children: i })
  ] });
  return /* @__PURE__ */ o("figure", { className: "block-img", children: (f = l.link) != null && f.url ? /* @__PURE__ */ o(
    "a",
    {
      href: (k = l.link) == null ? void 0 : k.url,
      rel: l.link.nofollow ? "nofollow" : void 0,
      target: l.link.newWindow ? "_blank" : void 0,
      children: r
    }
  ) : r });
};
export {
  I as default
};
//# sourceMappingURL=image.block.js.map
