const { h, Fragment } = require('preact')
const prettierBytes = require('@transloadit/prettier-bytes')
const truncateString = require('@uppy/utils/lib/truncateString')
const MetaErrorMessage = require('../MetaErrorMessage')
const renderFileName = (props) => {
const { author, name } = props.file.meta
function getMaxNameLength () {
if (props.containerWidth <= 352) {
return 35
}
if (props.containerWidth <= 576) {
return 60
}
// When `author` is present, we want to make sure
// the file name fits on one line so we can place
// the author on the second line.
return author ? 20 : 30
}
return (