import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import withWidth from '@material-ui/core/withWidth'; import { Card } from '@material-ui/core'; import * as Blockly from 'blockly' import CardContent from '@material-ui/core/CardContent'; import Typography from '@material-ui/core/Typography'; import ReactMarkdown from 'react-markdown'; class TooltipViewer extends Component { render() { return ( {Blockly.Msg.tooltip_viewer} {this.props.tooltip} {this.props.helpurl !== '' ? {`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`} : null} ); }; } TooltipViewer.propTypes = { tooltip: PropTypes.string.isRequired, helpurl: PropTypes.string.isRequired }; const mapStateToProps = state => ({ tooltip: state.workspace.code.tooltip, helpurl: state.workspace.code.helpurl }); export default connect(mapStateToProps, null)(withWidth()(TooltipViewer));