UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

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