/* global React */ import AffiliateItem from './AffiliateItem'; import { TEMPLATE_TYPE } from '../utils/constants'; const { __ } = wp.i18n; const style = { label: { paddingRight: '10px', }, buttonBox: { textAlign: 'center', }, button: { margin: '0 10px', }, }; export default class AmazonBlock extends React.Component { constructor( props ) { super( props ); this.state = { template: TEMPLATE_TYPE.IMAGE_MEDIUM, }; this.handleTemplateChange = this.handleTemplateChange.bind( this ); this.handleCancelClick = this.handleCancelClick.bind( this ); this.handleInsertClick = this.handleInsertClick.bind( this ); } handleTemplateChange( ev ) { this.setState( { template: ev.target.value, } ); } handleCancelClick() { const { event } = this.props; event.emit( 'SET_ITEM', null ); } handleInsertClick() { const { event } = this.props; event.emit( 'SET_TEMPLATE', this.state.template ); } render() { return (