UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

46 lines (45 loc) 1.03 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 u, b as A, c as E } from "./AdapterUploadCtxProvider-Bc0dv7HE.js"; t.defineComponents(t); const I = E({ react: e, tag: "uc-file-uploader-minimal", elClass: t.FileUploaderMinimal }), v = ({ ctxName: n, className: r, classNameUploader: o, apiRef: s, fallback: i, ...l }) => { const a = d( () => n ?? t.UID.generateRandomUUID(), [n] ), { eventHandlers: m, config: c } = g(l), p = f(); return /* @__PURE__ */ e.createElement(C, { condition: p, fallback: i }, /* @__PURE__ */ e.createElement("div", { className: r }, /* @__PURE__ */ e.createElement( U, { userAgentIntegration: u(), "ctx-name": a, ...c } ), /* @__PURE__ */ e.createElement( A, { ref: s, "ctx-name": a, ...m } ), /* @__PURE__ */ e.createElement( I, { class: o, "ctx-name": a } ))); }; export { v as FileUploaderMinimal };