
import React, {Component} from 'react'

import {OptionsFieldsListItem} from '~/components'
import * as hz from '~/utils/horizon/helpers'


class OptionsFieldsListItemContainer extends Component {
  destroyField() {
    hz.optionsFields.remove(this.props.field.id).subscribe(
      result => console.info(`Destroy - Field - Success\nId: "${result.id}"`),
      err => console.error(`Destroy - Field - Fail\nError: "${err}"`)
    )
  }
  render() {
    return <OptionsFieldsListItem
      destroyHandler={::this.destroyField}
      {...this.props}
      />
  }
}


export default OptionsFieldsListItemContainer

@@ -205,24 +205,171 @@
 oyField() %7B%0A
+    const isAgree = confirm(%60ID: $%7Bthis.props.field.id%7D%5CnReally want to destroy the field?%60)  // eslint-disable-line no-alert%0A    if (isAgree) %7B%0A  
     hz.optio
@@ -416,16 +416,18 @@
 scribe(%0A
+  
       re
@@ -503,16 +503,18 @@
 ,%0A      
+ 
+ 
 err =%3E c
@@ -573,17 +573,25 @@
 %22%60)%0A    
-)
+  )%0A    %7D
 %0A  %7D%0A  r

add protect from random destroy