 {StudentDashboardStore, StudentDashboardActions} = require '../../flux/student-dashboard'
 EventInfoIcon = require './event-info-icon'
 {Instructions} = require '../task/details'
+{SuretyGuard} = require 'shared'
 classnames = require 'classnames'
 
 module.exports = React.createClass

      {courseId:@props.courseId, id: @props.event.id, stepIndex: 1}

  hideTask: (event) ->
    event.stopPropagation()
    StudentDashboardActions.hide(@props.event.id)
    StudentDashboardStore.on('hidden', @hidden)

  hidden: -> @setState({hidden: true})


    classes = classnames("task row #{@props.className}", {workable, deleted})

    if deleted
      message = <div>
        <p>
          If you remove this assignment, you will lose any progress or feedback you have received.
        </p>
        <p>Do you wish to continue?</p>
      </div>

      hideButton =
        <SuretyGuard
          onConfirm={@hideTask}
          okButtonLabel='Yes'
          placement='top'
          message={message}
        >
          <BS.Button className="hide-task" onClick={@stopEventPropagation}>
            <i className="fa fa-close"/>
          </BS.Button>
        </SuretyGuard>

      feedback = <span>Withdrawn</span>
    else
      time = <Time date={@props.event.due_at} format='concise'/>
