import React from 'react'; import ReactDOM from 'react-dom' import ModalComponent from '../lib/ModalComponent'; import Modal from '../base/Modal'; import ModalBody from '../base/ModalBody'; import ModalHeader from '../base/ModalHeader'; import ModalFooter from '../base/ModalFooter'; import {exportCurl} from '../../lib/export/curl'; class CurlExportModal extends ModalComponent { constructor (props) { super(props); this.state = {cmd: ''}; } show (request) { super.show(); exportCurl(request._id).then(cmd => { this.setState({cmd}); }); } componentDidUpdate () { ReactDOM.findDOMNode(this.refs.textarea).select(); } render () { const {cmd} = this.state; return ( Export Request as Curl