 
 showItemDevResultDelay = if window.config.get('poi.delayItemDevResult', false) then 6200 else 500
 
+
+CountdownTimer = require './countdown-timer'
+CountdownLabel = React.createClass
+  getInitialState: ->
+    style: 'default'
+  tick: (timeRemaining) ->
+    style = 'default'
+    if timeRemaining > 600
+      style = if @props.isLSC then 'danger' else 'primary'
+    else if timeRemaining > 0
+      style = 'warning'
+    else if timeRemaining is 0
+      style = 'success'
+    @setState {style: style} if style isnt @state.style
+  notify: ->
+    console.log "ignore this notify" if @props.completeTime is 0
+    notify "#{@props.dockName} 建造完成",
+      type: 'construction'
+      icon: join(ROOT, 'assets', 'img', 'operation', 'build.png')
+  render: ->
+    <Label bsStyle={@state.style}>
+    {
+      if @props.completeTime >= 0
+        <CountdownTimer countdownId={"kdock-#{@props.dockIndex}"}
+                        completeTime={@props.completeTime}
+                        tickCallback={@tick}
+                        completeCallback={@notify} />
+    }
+    </Label>
+
+
 KdockPanel = React.createClass
   getInitialState: ->
     docks: [
         name: __ 'Empty'
         material: []
         completeTime: -1
-        countdown: -1
-      ,
-        name: __ 'Empty'
-        material: []
-        completeTime: -1
-        countdown: -1
-      ,
-        name: __ 'Empty'
-        material: []
-        completeTime: -1
-        countdown: -1
-      ,
-        name: __ 'Empty'
-        material: []
-        completeTime: -1
-        countdown: -1
-      ,
-        name: __ 'Empty'
-        material: []
-        completeTime: -1
-        countdown: -1
+      ,
+        name: __ 'Empty'
+        material: []
+        completeTime: -1
+      ,
+        name: __ 'Empty'
+        material: []
+        completeTime: -1
+      ,
+        name: __ 'Empty'
+        material: []
+        completeTime: -1
+      ,
+        name: __ 'Empty'
+        material: []
+        completeTime: -1
     ]
     notified: []
     show: true

                name: __ 'Locked'
                material: []
                completeTime: -1
                countdown: -1
            when 0
              docks[id] =
                name: __ 'Empty'
                material: []
                completeTime: -1
                countdown: -1
              notified[id] = false
            when 2
              docks[id] =

                  kdock.api_item5
                ]
                completeTime: kdock.api_complete_time
            when 3
              docks[id] =
                name: $ships[kdock.api_created_ship_id].api_name
