 KDButtonView           = kd.ButtonView
 KDListItemView         = kd.ListItemView
 KDCustomHTMLView       = kd.CustomHTMLView
+KDCheckBox             = kd.CheckBox
+KDListViewController = kd.ListViewController
+KDHitEnterInputView  = kd.HitEnterInputView
 
+TopicLeafItemView    = require './topicleafitemview'
+SimilarItemView      = require './similaritemview'
 
 module.exports = class TopicItemView extends KDListItemView
 

    @settings.addSubView deleteButton = new KDButtonView
      cssClass : 'solid compact outline'
      title    : 'DELETE CHANNEL'

  pistachio: ->
    data     = @getData()

        @typeLabel.toggleClass 'active'
    
    @createSettingsView()
    @createLeafChannelsListController()
    @createLeafItemViews (data)

  createLeafItemViews: (data) ->
    options = rootId  :  data.id
          
    kd.singletons.socialapi.moderation.list options, (err, channels) =>
      console.log arguments
      if err
        console.log "no leaf channel found for #{data.id}, #{data.name}"
        return
      @listLeafChannels channels
      
  listLeafChannels: (channels) ->

    unless channels.length
      return @leafChannelsListController.lazyLoader?.hide()

    @skip += channels.length

    for channel in channels
      @leafChannelsListController.addItem channel

    @leafChannelsListController.lazyLoader?.hide()

  createSettingsView: ->

