UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

29 lines 842 B
import React from 'react'; import { UploadContext } from "./UploadContext.js"; import FormStatus from "../FormStatus.js"; import useUpload from "./useUpload.js"; import HeightAnimation from "../height-animation/HeightAnimation.js"; 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, { state: "warn", shellSpace: { top: 'small' }, stretch: true }, String(errorAmountLimit).replace('%amount', String(filesAmountLimit)))); }; export default UploadStatus; //# sourceMappingURL=UploadStatus.js.map