import { j as e } from "../../../../../_virtual/jsx-runtime.js";
import { useBrickStyle as p } from "../hooks/use-brick-style.js";
import { a as f } from "../../../../sdk/dist/shared/chunk-X43MB5WD.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-UU2MSQXY.js";
import "../../../../sdk/dist/shared/chunk-T3LIA4YB.js";
import "../../../../sdk/dist/shared/chunk-YBGPPF7T.js";
import "../../../../sdk/dist/shared/chunk-UMHXXXVP.js";
import "../../../../sdk/dist/shared/chunk-5N6MBJJ4.js";
import { tx as i } from "../../../../style-system/dist/twind.js";
import u from "../components/BrickRoot.js";
function B({ brick: s, editable: r }) {
  const { props: o } = s, a = p(s), { image: l, ...m } = a, { src: t, alt: c } = o.image ?? {}, n = t?.includes("{{");
  return /* @__PURE__ */ e.jsxs(
    u,
    {
      brick: s,
      editable: r,
      manifest: f,
      as: "picture",
      className: i("group/image flex items-center justify-center", Object.values(m)),
      children: [
        !n && typeof t == "string" && t !== "" && /* @__PURE__ */ e.jsx(
          "img",
          {
            src: t,
            alt: c,
            className: i(
              "max-h-full w-full h-full rounded-[inherit] select-none pointer-events-none",
              l
            )
          }
        ),
        r && !t && /* @__PURE__ */ e.jsx(
          "div",
          {
            className: i(
              "rounded-[inherit] transition-opacity duration-300 group-hover/image:opacity-100 flex w-full h-full p-10 items-center justify-center font-semibold"
            ),
            children: /* @__PURE__ */ e.jsx("div", { className: "text-ellipsis text-nowrap flex-nowrap text-center", children: "No image set" })
          }
        ),
        r && n && /* @__PURE__ */ e.jsx(
          "div",
          {
            className: i(
              "rounded-[inherit] transition-opacity duration-300 flex items-center  w-full h-full justify-center font-medium p-10"
            ),
            children: /* @__PURE__ */ e.jsx("div", { className: "text-ellipsis text-nowrap flex-nowrap text-center", children: "Dynamic Image" })
          }
        )
      ]
    }
  );
}
export {
  B as default
};
//# sourceMappingURL=image.js.map
