         return component
 
 
-    renderSettings: ->
-        return Settings
-            ref     : 'settings'
-            settings: @state.settings
-
     getStateFromStores: ->
         return {
             accounts              : AccountStore.getAll()

            canLoadMore:          @state.queryParams.hasNextPage
            loadMoreMessage: -> MessageActionCreator.fetchMoreOfCurrentQuery()

    renderSearchResults: ->
        key = encodeURIComponent SearchStore.getCurrentSearch()
        return new SearchResult key: "search-#{key}"

    renderAccount: ->
        if @props.action is 'account.config'
            options =
                # don't use @state.selectedAccount
                ref               : "accountConfig"
                selectedAccount   : AccountStore.getSelected()
                error             : @state.accountError
                isWaiting         : @state.accountWaiting
                mailboxes         : @state.selectedMailboxes
                mailboxCounters   : @state.mailboxCounters
                favoriteMailboxes : @state.favoriteMailboxes
                tab               : @props.tab
            if options.selectedAccount? and
               not options.error and
               options.mailboxes.length is 0
                options.error =
                    name: 'AccountConfigError'
                    field: 'nomailboxes'

        else if @props.action is 'account.new'
            options =
                ref       : "accountNew"
                error     : @state.accountError
                isWaiting : @state.accountWaiting

        return AccountConfig options

    renderConversation: ->
        messageID = @props.messageID
        mailboxID = @props.mailboxID
        message   = MessageStore.getByID messageID
        selectedMailboxID = @props.selectedMailboxID
        if message?
            conversationID     = message.get 'conversationID'
            lengths            = MessageStore.getConversationsLength()
            conversationLength = lengths.get conversationID
            selectedMailboxID ?= Object.keys(message.get('mailboxIDs'))[0]
            trashMailboxID     = @state.selectedAccount?.get('trashMailbox')
            conversation       = MessageStore
                                .getConversation conversationID, trashMailboxID

        # don't display conversations in Trash and Draft folders
        conversationDisabledBoxes = [
            @state.selectedAccount?.get('trashMailbox')
            @state.selectedAccount?.get('draftMailbox')
            @state.selectedAccount?.get('junkMailbox')
        ]
        if mailboxID in conversationDisabledBoxes
            displayConversations = false
        else
            displayConversations = @state.settings.get 'displayConversation'

        prevMessage = MessageStore.getPreviousMessage()
        nextMessage = MessageStore.getNextMessage()

        # don't display conversation panel when there's no conversation
        # (happens sometime on deletion or filtering)
        return null unless conversationID?

        return Conversation
            key: 'conversation-' + conversationID
            settings             : @state.settings
            accounts             : @state.accounts
            mailboxes            : @state.mailboxes
            selectedAccountID    : @state.selectedAccount.get 'id'
            selectedAccountLogin : @state.selectedAccount.get 'login'
            selectedMailboxID    : selectedMailboxID
            conversationID       : conversationID
            conversation         : conversation
            conversationLength   : conversationLength
            prevMessageID        : prevMessage?.get 'id'
            prevConversationID   : prevMessage?.get 'conversationID'
            nextMessageID        : nextMessage?.get 'id'
            nextConversationID   : nextMessage?.get 'conversationID'
            ref                  : 'conversation'
            displayConversations : displayConversations
            useIntents           : @props.useIntents


    # Rendering the compose component requires several parameters. The main one
    # are related to the selected account, the selected mailbox and the compose
    # state (classic, draft, reply, reply all or forward).


        else if @props.action is 'search'

            key = encodeURIComponent SearchStore.getCurrentSearch()

            SearchResult
                key: "search-#{key}"

        # -- Generates a configuration window for a given account
        else if @props.action is 'account.config' or
                @props.action is 'account.new'

            id = @props.accountID or 'new'

            AccountConfig
                key: "account-config-#{id}"
                tab: @props.tab

        # -- Generates a conversation
        else if @props.action is 'message' or
                @props.action is 'conversation'

            Conversation
                messageID: @props.messageID
                key: 'conversation-' + @props.messageID
                ref: 'conversation'

        # -- Generates the new message composition form
        else if @props.action is 'compose' or
