       packet = JSON.parse packet
       @props.updateBattleDetail packet
       @setState
-        selectedTimestamp: 0
+        selectedPacket: packet
     finally
       window.showModal
         title: __ "Paste Data"

    return if index is NaN
    if index == -1
      packet = @props.battlePackets[0]
      timestamp = 0
      @props.toggleAutoShow true
    else
      packet = @props.battlePackets[index]
      timestamp = packet.poi_timestamp
      @props.toggleAutoShow false

    @setState
      selectedTimestamp: timestamp
    @props.updateBattleDetail packet

  handleClickExport: ->


OptionArea = React.createClass
  getInitialState: ->
    # selectedPacket can be 3 type
    #   null : Last battle packet
    #   packet in @props.battlePackets
    #   packet not in @props.battlePackets (imported)
    selectedPacket: null
  shouldComponentUpdate: (nextProps, nextState) ->
    return true if @state.selectedPacket?.poi_timestamp != nextState.selectedPacket?.poi_timestamp
    return false if @props.battlePacketsNonce == nextProps.battlePacketsNonce
    return true

