context = window
teacherActions = window.JK.Actions.Teacher

@Nav = React.createClass({

  mixins: [
    Reflux.listenTo(AppStore, "onAppInit"),
    Reflux.listenTo(NavStore, "onNavChanged")
  ]

  onAppInit: (@app) ->

  onNavChanged: (nav) ->
    @setState({nav: nav})

  render: () ->
    navs = []
    if this.state?.nav?
      nav = this.state.nav
      if nav.currentSection?
        navs.push(`<span>&nbsp;:&nbsp;</span>`)
        navs.push(`<a href={nav.currentSection.url} >{nav.currentSection.name}</a>`)
      if nav.optionalParent?
        navs.push(`<span>&nbsp;:&nbsp;</span>`)
        navs.push(`<a href={nav.optionalParent.url} >{nav.optionalParent.name}</a>`)
      if nav.currentScreenName?
        navs.push(`<span>&nbsp;:&nbsp;</span>`)
        navs.push(`<span styles={{color:'#ccc'}}>{nav.currentScreenName}</span>`)

    `<div className="site-nav">
      <a href="/client#/home" >JamKazam Home</a>
      {navs}
    </div>`
})