UNPKG

@novin-dev/formalite

Version:

Generate MUI form with few line of code

41 lines (38 loc) 1.79 kB
import React from 'react'; import { alpha } from '@mui/material/styles'; import { Paper, Box, Typography } from '@mui/material'; import { fData } from '../../../config/utils.js'; function RejectionFiles(_a) { var fileRejections = _a.fileRejections, fileState = _a.fileState; return (React.createElement(Paper, { variant: "outlined", sx: { py: 1, px: 2, mt: 1, borderColor: "error.light", bgcolor: function (theme) { return alpha(theme.palette.error.main, 0.08); }, } }, fileState && fileState.errorText && (React.createElement(Box, { sx: { my: 1 } }, React.createElement(Typography, { variant: "subtitle2", noWrap: true }, fileState.original === "default" ? fileState.originalName : fileState.name, " ", "- ", fData(fileState.size || 0)), React.createElement(Typography, { variant: "caption", component: "p" }, "- ", fileState.errorText))), fileRejections.map(function (_a) { var file = _a.file, errors = _a.errors; return (React.createElement(Box, { key: file.name, sx: { my: 1 } }, React.createElement(Typography, { variant: "subtitle2", noWrap: true }, file.name, " - ", fData(file.size)), errors.map(function (error) { return (React.createElement(Typography, { key: error.code, variant: "caption", component: "p" }, "- ", error.message)); }))); }))); } export { RejectionFiles as default }; //# sourceMappingURL=RejectionFiles.js.map