import Ember from 'ember'
export default Ember.Component.extend
  isEditing: false
  selectedViewItem: null
  doubleClick: -> @toggleProperty("isEditing")
  actions:
    selectViewItem: (tracker_group, select_component)->
      if current_tracker_group = @get("current_tracker_group")
        @get("workflow_group.tracker_groups").then (tracker_groups)->
          tracker_groups.removeObject current_tracker_group
      unless tracker_group
        @get("workflow_group").save()
        return

      @get("workflow_group.tracker_groups").then (tracker_groups)->
        tracker_groups.pushObject(tracker_group)
      @get("workflow_group").save()
  set_selected: (->
    @set("selectedViewItem", @get("current_tracker_group"))
  ).on("didReceiveAttrs")
