const html = require('choo/html'); const assets = require('../../../common/assets'); const bytes = require('../../utils').bytes; const fileIcon = require('../fileIcon'); module.exports = function(file, index, state, emit, hasPassword) { const cancelVisible = state.route === '/' && !state.uploading ? 'uploadedFile__cancel--visible' : ''; function cancel(event) { event.preventDefault(); if (state.route === '/') { emit('removeUpload', { index }); } } return html`
  • ${fileIcon(file.name, hasPassword)}
    cancel

    ${file.name}

    ${bytes(file.size)}

  • `; };