<commit_before>React = require 'react/addons'
Immutable = require 'immutable'
moment = require 'moment'

{div, ul, li, a, span, i, p} = React.DOM
classer = React.addons.classSet

RouterMixin = require '../mixins/RouterMixin'

module.exports = EmailList = React.createClass
    displayName: 'EmailList'

    mixins: [RouterMixin]

    shouldComponentUpdate: (nextProps, nextState) ->
        return not Immutable.is(nextProps.emails, @props.emails) or
               not Immutable.is(nextProps.openEmail, @props.openEmail)

    render: ->
        div id: 'email-list',
            ul className: 'list-unstyled',
                @props.emails.map (email, key) =>
                    # only displays initial email of a thread
                    if email.inReplyTo.length is 0
                        isActive = @props.openEmail? and
                                   @props.openEmail.id is email.id
                        @getEmailRender email, key, isActive
                .toJS()<commit_msg>Added: message when there is no email for mailbox/imap folder<commit_after>React = require 'react/addons'
Immutable = require 'immutable'
moment = require 'moment'

{div, ul, li, a, span, i, p} = React.DOM
classer = React.addons.classSet

RouterMixin = require '../mixins/RouterMixin'

module.exports = EmailList = React.createClass
    displayName: 'EmailList'

    mixins: [RouterMixin]

    shouldComponentUpdate: (nextProps, nextState) ->
        return not Immutable.is(nextProps.emails, @props.emails) or
               not Immutable.is(nextProps.openEmail, @props.openEmail)

    render: ->
        div id: 'email-list',
            if @props.emails.count() is 0
                'No email in this box.'
            else
                ul className: 'list-unstyled',
                    @props.emails.map (email, key) =>
                        # only displays initial email of a thread
                        if email.inReplyTo.length is 0
                            isActive = @props.openEmail? and
                                       @props.openEmail.id is email.id
                            @getEmailRender email, key, isActive
                    .toJS()
{'fraction_non_alphanumeric': 0.09783110290724505, 'fraction_numerical': 0.0013844023996308261, 'mean_word_length': 1.8451443569553805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6873872', 'n_tokens_mistral': 619, 'n_tokens_neox': 597, 'n_words': 162}