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