import React, { forwardRef } from 'react';
import { identity } from 'ramda';
import MenuItem from '@mui/material/MenuItem';
import Typography from '@mui/material/Typography';
import CheckIcon from '@mui/icons-material/Check';
import { useStyles } from './styles';
export var MenuItemRenderer = forwardRef(function (_a, ref) {
    var item = _a.item, _b = _a.onMenuClose, onMenuClose = _b === void 0 ? identity : _b;
    var styles = useStyles();
    var text = item.text, selected = item.selected, onClick = item.onClick;
    var handleClick = function (e) {
        onMenuClose();
        onClick(e);
    };
    return (React.createElement(MenuItem, { classes: { root: styles.menuItem }, onClick: handleClick, ref: ref },
        selected && React.createElement(CheckIcon, { className: styles.checkIcon }),
        React.createElement(Typography, { classes: { root: styles.menuText } }, text)));
});
MenuItemRenderer.displayName = 'MenuItemRenderer';
