UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

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