UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

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