UNPKG

@itwin/itwinui-react

Version:

A react component library for iTwinUI

42 lines (41 loc) 1.44 kB
import * as React from 'react'; import { Box, polymorphic, SvgUpload } from '../../utils/index.js'; import cx from 'classnames'; import { FileUploadCard } from './FileUploadCard.js'; let FileEmptyCardIcon = polymorphic.span('iui-file-card-empty-icon', { children: React.createElement(SvgUpload, null), }); if ('development' === process.env.NODE_ENV) FileEmptyCardIcon.displayName = 'FileEmptyCard.Icon'; let FileEmptyCardText = polymorphic.span('iui-file-card-empty-action'); if ('development' === process.env.NODE_ENV) FileEmptyCardText.displayName = 'FileEmptyCard.Text'; let FileEmptyCardComponent = React.forwardRef((props, ref) => { let { children, className, ...rest } = props; return React.createElement( Box, { className: cx('iui-file-card-empty', className), ref: ref, ...rest, }, children ?? React.createElement( React.Fragment, null, React.createElement(FileEmptyCard.Icon, null), React.createElement( FileEmptyCard.Text, null, React.createElement(FileUploadCard.InputLabel, null, 'Choose a file'), React.createElement('div', null, 'to upload.'), ), ), ); }); if ('development' === process.env.NODE_ENV) FileEmptyCardComponent.displayName = 'FileEmptyCard'; export const FileEmptyCard = Object.assign(FileEmptyCardComponent, { Icon: FileEmptyCardIcon, Text: FileEmptyCardText, });