UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

43 lines (42 loc) 1.01 kB
import * as t from "@uploadcare/file-uploader"; import e, { useMemo as d } from "react"; import { g, u as f, C, A as u, a as A, b as U, c as E } from "./AdapterUploadCtxProvider--oZg9dbA.js"; t.defineComponents(t); const M = E({ react: e, tag: "uc-file-uploader-minimal", elClass: t.FileUploaderMinimal }), v = ({ ctxName: r, className: n, classNameUploader: o, apiRef: s, fallback: i, ...l }) => { const a = d(() => r ?? t.UID.generate(), [r]), { eventHandlers: c, config: m } = g(l), p = f(); return /* @__PURE__ */ e.createElement(C, { condition: p, fallback: i }, /* @__PURE__ */ e.createElement("div", { className: n }, /* @__PURE__ */ e.createElement( u, { userAgentIntegration: A(), "ctx-name": a, ...m } ), /* @__PURE__ */ e.createElement( U, { ref: s, "ctx-name": a, ...c } ), /* @__PURE__ */ e.createElement( M, { class: o, "ctx-name": a } ))); }; export { v as FileUploaderMinimal };