@braineet/ui
Version:
Braineet design system
39 lines (38 loc) • 1.72 kB
JavaScript
var _excluded = ["state", "children", "showUploadList", "uploadItemStatus", "options", "openRef", "inputProps", "texts"];
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
/* eslint-disable react/no-array-index-key */
import React from 'react';
import { UploadList } from './UploadList';
import { UploadProvider } from './UploadProvider';
import UploadRenderer from './UploadRenderer';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
export var Upload = function Upload(_ref) {
var state = _ref.state,
children = _ref.children,
showUploadList = _ref.showUploadList,
uploadItemStatus = _ref.uploadItemStatus,
options = _ref.options,
openRef = _ref.openRef,
inputProps = _ref.inputProps,
texts = _ref.texts,
restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
return /*#__PURE__*/_jsxs(UploadProvider, _extends({
state: state
}, restProps, {
children: [/*#__PURE__*/_jsx(UploadRenderer, {
state: state,
options: options,
openRef: openRef,
inputProps: inputProps,
children: children
}), showUploadList ? /*#__PURE__*/_jsx(UploadList, {
state: state,
uploadItemStatus: uploadItemStatus,
texts: texts
}) : null]
}));
};
Upload.defaultProps = {
showUploadList: true
};