1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/frontend/src/component/feature/FeatureStrategy/FeatureStrategyIcon/FeatureStrategyIcon.tsx
olav 69171a75a7 refactor: improve button label markup (#1091)
* refactor: improve button label markup

* refactor: remove misused tooltip roles

* refactor: simplify FeatureStrategyIcon labelling

* refactor: simplify labels for disabled buttons

* refactor: add missing switch input labels
2022-06-17 11:27:54 +02:00

36 lines
805 B
TypeScript

import {
getFeatureStrategyIcon,
formatStrategyName,
} from 'utils/strategyNames';
import { styled, Tooltip } from '@mui/material';
interface IFeatureStrategyIconProps {
strategyName: string;
}
export const FeatureStrategyIcon = ({
strategyName,
}: IFeatureStrategyIconProps) => {
const Icon = getFeatureStrategyIcon(strategyName);
return (
<StyledIcon>
<Tooltip title={formatStrategyName(strategyName)} arrow>
<Icon />
</Tooltip>
</StyledIcon>
);
};
const StyledIcon = styled('div')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: theme.palette.inactiveIcon,
'& svg': {
width: theme.spacing(2.5),
height: theme.spacing(2.5),
},
}));