1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00
unleash.unleash/frontend/src/component/common/StrategySeparator/StrategySeparator.tsx
Thomas Heartman b84699f563
refactor(1-3439): extract shared components and styling from Env Accordion Body to common (#9590)
Extracts the shared strategy list and list item into the `common` folder
instead of living in the environment accordion body file.

Also takes the disabled strategy handling that we use for
`StrategySeparator` and moves it into the file itself. It might be
something we want to decorate manually in the future, but we don't for
now, so this was the most straight-forward way to make it work.
2025-03-24 07:39:35 +00:00

26 lines
801 B
TypeScript

import { styled } from '@mui/material';
import { disabledStrategyClassName } from '../StrategyItemContainer/disabled-strategy-utils';
const Chip = styled('div')(({ theme }) => ({
padding: theme.spacing(0.75, 1),
fontSize: theme.fontSizes.smallerBody,
position: 'absolute',
zIndex: theme.zIndex.fab,
top: 0,
transform: 'translateY(-50%)',
lineHeight: 1,
borderRadius: theme.shape.borderRadiusLarge,
backgroundColor: theme.palette.secondary.border,
left: theme.spacing(4),
// if the strategy it's applying to is disabled
[`&:has(+ * .${disabledStrategyClassName}, + .${disabledStrategyClassName})`]:
{
filter: 'grayscale(.8)',
},
}));
export const StrategySeparator = () => {
return <Chip role='separator'>OR</Chip>;
};