const html = require('choo/html'); const number = require('../../utils').number; const bytes = require('../../utils').bytes; const fileIcon = require('../fileIcon'); module.exports = function(file, state) { const ttl = file.expiresAt - Date.now(); const remainingTime = timeLeft(ttl, state) || state.translate('linkExpiredAlt'); const downloadLimit = file.dlimit || 1; const totalDownloads = file.dtotal || 0; const multiFiles = file.manifest.files; const fileName = multiFiles.length > 1 ? `${multiFiles[0].name} + ${state.translate('fileCount', { num: multiFiles.length - 1 })}` : file.name; const activeClass = isOnSharePage() ? 'fileToast--active' : ''; return html`
${fileName}
${bytes(file.size)} ยท ${state.translate('downloadCount', { num: `${number(totalDownloads)} / ${number(downloadLimit)}` })} ${remainingTime}