mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-10 01:19:53 +01:00
We're migrating to ESM, which will allow us to import the latest versions of our dependencies. Co-Authored-By: Christopher Kolstad <chriswk@getunleash.io>
30 lines
844 B
TypeScript
30 lines
844 B
TypeScript
import type { ReactNode, VFC } from 'react';
|
|
import { Box } from '@mui/material';
|
|
import { Badge } from 'component/common/Badge/Badge';
|
|
import { ChangeItemWrapper } from './StrategyChange.tsx';
|
|
|
|
interface IToggleStatusChange {
|
|
enabled: boolean;
|
|
actions?: ReactNode;
|
|
}
|
|
|
|
export const ToggleStatusChange: VFC<IToggleStatusChange> = ({
|
|
enabled,
|
|
actions,
|
|
}) => {
|
|
return (
|
|
<ChangeItemWrapper>
|
|
<Box sx={{ display: 'flex', alignItems: 'center' }}>
|
|
New status:{' '}
|
|
<Badge
|
|
sx={(theme) => ({ marginLeft: theme.spacing(1) })}
|
|
color={enabled ? 'success' : 'error'}
|
|
>
|
|
{enabled ? ' Enabled' : 'Disabled'}
|
|
</Badge>
|
|
</Box>
|
|
{actions}
|
|
</ChangeItemWrapper>
|
|
);
|
|
};
|