_ = require 'lodash'




angular.module('vision').component 'visionTaskGroups',
  template: do require './index.jade'
  controllerAs: 'vm'
  bindings:
    group: '='
  controller: ($scope, $vision, $mdColors) ->
    'ngInject'; $vision.attach(module, $scope); vm = @

    selectedColor = $mdColors.getThemeColor('blue-200')

    @groups = []
    @groups.push icon: 'inbox', title: 'Входящие', name: 'inbox'
    @groups.push icon: 'today', title: 'Сегодня', name: 'today'
    @groups.push icon: 'date_range', title: 'Завтра', name: 'tomorrow'
    @groups.push icon: 'storage', title: 'Следующие', name: 'next'
    @groups.push icon: 'cloud', title: 'Когда-нибудь', name: 'someday'
    @groups.push icon: 'send', title: 'Ожидание', name: 'wait'

    @state.on 'group', (params) =>
      @group = params.group


    @getStyle = (g) ->
      "background: #{selectedColor}" if g.name is @group


    return
