_ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions} = require 'nylas-exports' {InjectedComponentSet, ListTabular} = require 'nylas-component-kit' {subject} = require './formatting-utils' 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()).join(', ')}
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} StatusColumn = new ListTabular.Column name: "State" resolver: (draft) => module.exports = Wide: [ParticipantsColumn, ContentsColumn, StatusColumn]