context = window
rest = window.JK.Rest()
logger = context.JK.logger

@LanguageCheckBoxList = React.createClass({

  mixins: [Reflux.listenTo(@LanguageStore,"onLanguagesChanged")]

  propTypes: {
    onItemChanged: React.PropTypes.func.isRequired
  }

  getDefaultProps: () ->
    selectedLanguages: []

  getInitialState: () ->
    {languages: []}

  onLanguagesChanged: (languages) ->
    @setState({languages: languages})

  render: () ->
    `<div className="LanguageCheckBoxList react-component">
        <CheckBoxList objectName='languages' onItemChanged={this.props.onItemChanged} sourceObjects={this.state.languages} selectedObjects={this.props.selectedLanguages}/>
    </div>`
})