"use client";
import { j as r } from "../../../node_modules/.pnpm/react@19.1.0/node_modules/react/jsx-runtime.mjs";
import { Image as a } from "@mantine/core";
import { Dropzone as j } from "@mantine/dropzone";
import p from "../../../node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.mjs";
import e from "./ImageInput.module.scss.mjs";
import l from "../../../node_modules/.pnpm/@tabler_icons-react@3.34.0_react@19.1.0/node_modules/@tabler/icons-react/dist/esm/icons/IconPhoto.mjs";
const x = ["image/png", "image/jpeg"];
function R({
  onImageDropped: m,
  value: n,
  classNames: o,
  i18n: c = { hint: "Click or drag and drop to upload" },
  imageComponent: d,
  ...g
}) {
  const f = (i) => {
    i.length > 0 && m(i[0]);
  };
  let t;
  return typeof n == "string" ? t = n : n instanceof File && (t = URL.createObjectURL(n)), /* @__PURE__ */ r.jsx(
    j,
    {
      onDrop: f,
      accept: x,
      classNames: {
        inner: p(e.inner, o == null ? void 0 : o.inner),
        root: p(e.dropzoneRoot, o == null ? void 0 : o.root)
      },
      ...g,
      children: t ? /* @__PURE__ */ r.jsx(
        a,
        {
          src: t,
          className: e.image,
          alt: "",
          component: d
        }
      ) : /* @__PURE__ */ r.jsxs("div", { className: e.imageDropContainer, children: [
        /* @__PURE__ */ r.jsx(l, { color: "#9595A8", size: 64 }),
        /* @__PURE__ */ r.jsx("div", { className: "body", children: c.hint })
      ] })
    }
  );
}
export {
  R as default
};
//# sourceMappingURL=index.mjs.map
