UNPKG

@uploadcare/react-uploader

Version:

React component for file uploads using Uploadcare

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