+{CompositeDisposable} = require 'atom'
 {View} = require 'atom-space-pen-views'
 
 module.exports =

      @removeClass 'disabled'
    else
      @addClass 'disabled'

  @content: ->
    @div class: 'icon'

  initialize: (icon, callback, tooltip = null, iconset = null) ->
    @subscriptions = new CompositeDisposable

    iconClass = if !iconset then 'icon-' + icon else iconset + '-' + icon

    @addClass 'icon ' + iconClass

    if tooltip
      @prop 'title', tooltip
      @subscriptions.add atom.tooltips.add(@, title: tooltip)

    if iconset
      @addClass iconset

