<commit_before>// @flow
import React, { useState } from "react"
import { makeStyles } from "@material-ui/core/styles"
import IconButton from "@material-ui/core/IconButton"
import Menu from "@material-ui/core/Menu"
import MenuItem from "@material-ui/core/MenuItem"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"

const useStyles = makeStyles(theme => ({
  icon: {
    color: "#fff",
    paddingRight: "5px",
  },
  menuItem: {
    fontSize: "0.8rem",
  },
}))

/**
 * StrainCatalogAppBarRightMenu contains the icon and display logic
 * for the right menu in the app bar.
 */

const StrainCatalogAppBarRightMenu = () => {
  const [anchorEl, setAnchorEl] = useState(null)
  const open = Boolean(anchorEl)
  const classes = useStyles()

  const handleClick = event => {
    setAnchorEl(event.currentTarget)
  }

  const handleClose = () => {
    setAnchorEl(null)
  }

  return (
    <>
      <IconButton size="small" className={classes.icon} onClick={handleClick}>
        <FontAwesomeIcon icon="ellipsis-v" />
      </IconButton>
      <Menu id="menu" anchorEl={anchorEl} open={open} onClose={handleClose}>
        <MenuItem onClick={handleClose} className={classes.menuItem}>
          <FontAwesomeIcon icon="download" size="sm" />
          &nbsp; Download PDF
        </MenuItem>
        <MenuItem onClick={handleClose} className={classes.menuItem}>
          <FontAwesomeIcon icon="download" size="sm" />
          &nbsp; Download CSV
        </MenuItem>
      </Menu>
    </>
  )
}

export default StrainCatalogAppBarRightMenu<commit_msg>feat: add help item to right side menu #227<commit_after>// @flow
import React, { useState } from "react"
import { makeStyles } from "@material-ui/core/styles"
import IconButton from "@material-ui/core/IconButton"
import Menu from "@material-ui/core/Menu"
import MenuItem from "@material-ui/core/MenuItem"
import Divider from "@material-ui/core/Divider"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"

const useStyles = makeStyles(theme => ({
  icon: {
    color: "#fff",
    paddingRight: "5px",
  },
  menuItem: {
    fontSize: "0.8rem",
  },
}))

/**
 * StrainCatalogAppBarRightMenu contains the icon and display logic
 * for the right menu in the app bar.
 */

const StrainCatalogAppBarRightMenu = () => {
  const [anchorEl, setAnchorEl] = useState(null)
  const open = Boolean(anchorEl)
  const classes = useStyles()

  const handleClick = event => {
    setAnchorEl(event.currentTarget)
  }

  const handleClose = () => {
    setAnchorEl(null)
  }

  return (
    <>
      <IconButton size="small" className={classes.icon} onClick={handleClick}>
        <FontAwesomeIcon icon="ellipsis-v" />
      </IconButton>
      <Menu id="menu" anchorEl={anchorEl} open={open} onClose={handleClose}>
        <MenuItem onClick={handleClose} className={classes.menuItem}>
          <FontAwesomeIcon icon="download" size="sm" />
          &nbsp; Download PDF
        </MenuItem>
        <MenuItem onClick={handleClose} className={classes.menuItem}>
          <FontAwesomeIcon icon="download" size="sm" />
          &nbsp; Download CSV
        </MenuItem>
        <Divider />
        <MenuItem onClick={handleClose} className={classes.menuItem}>
          <FontAwesomeIcon icon="info-circle" size="sm" />
          &nbsp; Help
        </MenuItem>
      </Menu>
    </>
  )
}

export default StrainCatalogAppBarRightMenu
{'fraction_non_alphanumeric': 0.13492766459994096, 'fraction_numerical': 0.002657218777679362, 'mean_word_length': 3.349165596919127, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3229106', 'n_tokens_mistral': 1030, 'n_tokens_neox': 1026, 'n_words': 239}