       # We shouldn't do anything.
 
   onSortChange: (name, ascending) ->
+    console.log name, ascending
     @setState update @state,
       activeSort: $set: {name: name, ascending: ascending}
 

  propTypes:
    name: React.PropTypes.string.isRequired

  getInitialState: ->
    ascending: true
    focused: false

  #TODO: Needs reworked.
  handleClick: (e) ->
    if not @state.focused and false
      @setState update @state,
        focused: $set: true
    else
      @setState update @state,
        ascending: $set: !@state.ascending

     @props.onSortChange @props.name, !@state.ascending

  render: ->
    glyph = if @state.ascending then <Glyphicon glyph="chevron-up"/> else <Glyphicon glyph="chevron-down"/>
    <Button active={@props.active} onClick={@handleClick}>{@props.name} {glyph}</Button>

ProblemFilter = React.createClass
  propTypes:

      problemFooter = @props.tags.map (tag, i) ->
        <Label key={i}>{tag}</Label>

    #Do something interesting here.
    panelStyle = if @props.disabled then "default" else "default"

    submissionDisplay = if @props.submissions and @props.submissions.valid + @props.submissions.invalid >= 1 then \
    <ProblemSubmissionDoughnut valid={@props.submissions.valid} invalid={@props.submissions.invalid} visible={@state.expanded}/>
