import React from 'react'; import { fade, makeStyles, Theme } from '@material-ui/core/styles'; import Avatar from '@material-ui/core/Avatar'; import { green } from '@material-ui/core/colors'; import { Badge, Button, Tooltip, Zoom } from '@material-ui/core'; import { useTranslation } from 'react-i18next'; const useStyles = makeStyles( (theme) => ({ root: { padding: 0, marginTop: theme.spacing(3), }, avatar: { '&:hover': { backgroundColor: ({ backgroundColor }) => fade(backgroundColor, 0.6), }, backgroundColor: ({ backgroundColor }) => backgroundColor, color: ({ color }) => color, boxShadow: theme.shadows[2], width: theme.spacing(8), height: theme.spacing(8), fontSize: theme.typography.h4.fontSize, }, tooltip: { fontSize: 12, }, }) ); export const AppIcon = ({ id, nameLocale, name, icon, backgroundColor, color, notification, }) => { const { t } = useTranslation(); const classes = useStyles({ backgroundColor: backgroundColor || green[50], color: color || green[400], }); return ( ); };