_ = require 'underscore' React = require 'react' classNames = require 'classnames' {ListTabular, InjectedComponent, Flexbox} = require 'nylas-component-kit' {timestamp, subject} = require './formatting-utils' {Actions} = require 'nylas-exports' SendingProgressBar = require './sending-progress-bar' SendingCancelButton = require './sending-cancel-button' snippet = (html) => return "" unless html and typeof(html) is 'string' try @draftSanitizer ?= document.createElement('div') @draftSanitizer.innerHTML = html[0..400] text = @draftSanitizer.innerText text[0..200] catch return "" ParticipantsColumn = new ListTabular.Column name: "Participants" width: 200 resolver: (draft) => list = [].concat(draft.to, draft.cc, draft.bcc) if list.length > 0
{list.map (p) => {p.displayName()}}
else
(No Recipients)
ContentsColumn = new ListTabular.Column name: "Contents" flex: 4 resolver: (draft) => attachments = [] if draft.files?.length > 0 attachments =
{subject(draft.subject)} {snippet(draft.body)} {attachments} SendStateColumn = new ListTabular.Column name: "State" resolver: (draft) => if draft.uploadTaskId else {timestamp(draft.date)} module.exports = Wide: [ParticipantsColumn, ContentsColumn, SendStateColumn]