UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

29 lines 858 B
import "core-js/modules/es.string.replace.js"; import React from 'react'; import { UploadContext } from './UploadContext'; import FormStatus from '../FormStatus'; import useUpload from './useUpload'; import HeightAnimation from '../height-animation/HeightAnimation'; const UploadStatus = () => { const context = React.useContext(UploadContext); const { id, filesAmountLimit, errorAmountLimit } = context; const { internalFiles } = useUpload(id); const open = internalFiles.length > filesAmountLimit; return React.createElement(HeightAnimation, { open: open, delay: 500 }, React.createElement(FormStatus, { shellSpace: { top: 'small' }, stretch: true }, String(errorAmountLimit).replace('%amount', String(filesAmountLimit)))); }; export default UploadStatus; //# sourceMappingURL=UploadStatus.js.map