1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-28 17:55:15 +02:00
unleash.unleash/frontend/src/component/common/EnvironmentIcon/EnvironmentIcon.tsx
Tymoteusz Czech 6d130f61f6 feat: new contexts table (#998)
* feat: new contexts table

* improve context list actions

* refactor: disabled icon colors

* fix: update snapshots

* fix: icons

* fix: context fields typo
2022-05-20 08:29:23 +00:00

42 lines
1000 B
TypeScript

import { useTheme } from '@mui/material/styles';
import { Cloud } from '@mui/icons-material';
interface IEnvironmentIcon {
enabled: boolean;
className?: string;
}
const EnvironmentIcon = ({ enabled, className }: IEnvironmentIcon) => {
const theme = useTheme();
const title = enabled ? 'Environment enabled' : 'Environment disabled';
const container = {
backgroundColor: enabled
? theme.palette.primary.light
: theme.palette.inactiveIcon,
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}>
<Cloud style={icon} titleAccess={title} />
</div>
);
};
export default EnvironmentIcon;