import React, {Component} from 'react'; import './MessageAction.scss'; import {Modal} from "react-bootstrap"; import TextField from "./fields/TextField"; import ButtonField from "./fields/ButtonField"; class MessageAction extends Component { constructor(props) { super(props); this.state = { copyButtonText: "copy" }; this.actionValue = React.createRef(); this.copyActionValue = this.copyActionValue.bind(this); } copyActionValue() { this.actionValue.current.select(); document.execCommand('copy'); this.setState({copyButtonText: "copied!"}); setTimeout(() => this.setState({copyButtonText: "copy"}), 3000); } render() { return ( {this.props.actionName} ); } } export default MessageAction;