UNPKG

@uppy/dashboard

Version:

Universal UI plugin for Uppy.

41 lines 1.19 kB
import { h } from 'preact'; import classNames from 'classnames'; import { useRef } from 'preact/hooks'; import ignoreEvent from '../utils/ignoreEvent.js'; function PickerPanelContent(_ref) { let { activePickerPanel, className, hideAllPanels, i18n, state, uppy } = _ref; const ref = useRef(null); return h("div", { className: classNames('uppy-DashboardContent-panel', className), role: "tabpanel", "data-uppy-panelType": "PickerPanel", id: `uppy-DashboardContent-panel--${activePickerPanel.id}`, onDragOver: ignoreEvent, onDragLeave: ignoreEvent, onDrop: ignoreEvent, onPaste: ignoreEvent }, h("div", { className: "uppy-DashboardContent-bar" }, h("div", { className: "uppy-DashboardContent-title", role: "heading", "aria-level": "1" }, i18n('importFrom', { name: activePickerPanel.name })), h("button", { className: "uppy-DashboardContent-back", type: "button", onClick: hideAllPanels }, i18n('cancel'))), h("div", { ref: ref, className: "uppy-DashboardContent-panelBody" }, uppy.getPlugin(activePickerPanel.id).render(state, ref.current))); } export default PickerPanelContent;