2022-05-02 15:52:41 +02:00
|
|
|
import { useTheme } from '@mui/material/styles';
|
|
|
|
import { Cloud } from '@mui/icons-material';
|
2021-11-12 11:47:19 +01:00
|
|
|
|
|
|
|
interface IEnvironmentIcon {
|
|
|
|
enabled: boolean;
|
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const EnvironmentIcon = ({ enabled, className }: IEnvironmentIcon) => {
|
|
|
|
const theme = useTheme();
|
|
|
|
|
2022-04-21 08:26:49 +02:00
|
|
|
const title = enabled ? 'Environment enabled' : 'Environment disabled';
|
|
|
|
|
2021-11-12 11:47:19 +01:00
|
|
|
const container = {
|
|
|
|
backgroundColor: enabled
|
|
|
|
? theme.palette.primary.light
|
|
|
|
: theme.palette.grey[600],
|
|
|
|
borderRadius: '50%',
|
|
|
|
width: '28px',
|
|
|
|
height: '28px',
|
|
|
|
minWidth: '28px',
|
|
|
|
display: 'flex',
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
marginRight: '0.5rem',
|
|
|
|
};
|
|
|
|
|
|
|
|
const icon = {
|
|
|
|
fill: '#fff',
|
|
|
|
width: '17px',
|
|
|
|
height: '17px',
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div style={container} className={className}>
|
2022-04-21 08:26:49 +02:00
|
|
|
<Cloud style={icon} titleAccess={title} />
|
2021-11-12 11:47:19 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default EnvironmentIcon;
|