import copyIcon from '@fortawesome/fontawesome-free-regular/faCopy'; import FontAwesomeIcon from '@fortawesome/react-fontawesome'; import { isNil } from 'ramda'; import React from 'react'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import './CreateShortUrlResult.scss' import { Card, CardBody, Tooltip } from 'reactstrap'; export default class CreateShortUrlResult extends React.Component { state = { showCopyTooltip: false }; componentDidMount() { this.props.resetCreateShortUrl(); } render() { const { error, result } = this.props; if (error) { return ( An error occurred while creating the URL :( ); } if (isNil(result)) { return null; } const { shortUrl } = result; const onCopy = () => { this.setState({ showCopyTooltip: true }); setTimeout(() => this.setState({ showCopyTooltip: false }), 2000); }; return ( Great! The short URL is {shortUrl} Copied! ); } };