import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import * as Blockly from 'blockly/core'; import withWidth, { isWidthDown } from '@material-ui/core/withWidth'; import { withStyles } from '@material-ui/core/styles'; import Tooltip from '@material-ui/core/Tooltip'; import IconButton from '@material-ui/core/IconButton'; import Chip from '@material-ui/core/Chip'; import Avatar from '@material-ui/core/Avatar'; import Popover from '@material-ui/core/Popover'; import { faPuzzlePiece, faTrash, faPlus, faPen, faArrowsAlt, faEllipsisH } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; const styles = (theme) => ({ stats: { backgroundColor: theme.palette.primary.main, display: 'inline', marginLeft: '50px', padding: '3px 10px', // borderRadius: '25%' }, menu: { backgroundColor: theme.palette.secondary.main, color: theme.palette.secondary.contrastText, width: '40px', height: '40px', '&:hover': { backgroundColor: theme.palette.secondary.main, color: theme.palette.primary.main, } } }); class WorkspaceStats extends Component { state = { anchor: null } handleClose = () => { this.setState({ anchor: null }); } handleClick = (event) => { this.setState({ anchor: event.currentTarget }); }; render() { const bigDisplay = !isWidthDown('sm', this.props.width); const workspace = Blockly.getMainWorkspace(); const remainingBlocksInfinity = workspace ? workspace.remainingCapacity() !== Infinity : null; const stats =