1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-19 17:52:45 +02:00
unleash.unleash/frontend/src/component/strategies/CustomStrategyInfo/CustomStrategyInfo.tsx

73 lines
2.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Alert, Box, Typography } from '@mui/material';
import { FC } from 'react';
const Paragraph: FC = ({ children }) => (
<Typography
component={'span'}
variant="body2"
sx={theme => ({
marginBottom: theme.spacing(2),
})}
>
{children}
</Typography>
);
export const CustomStrategyInfo: FC<{ alert?: boolean }> = ({ alert }) => {
const content = (
<>
<Paragraph>
We recommend you to use the predefined strategies like Gradual
rollout with constraints instead of creating a custom strategy.
</Paragraph>
<Paragraph>
If you decide to create a custom strategy be aware of:
<ul>
<li>
They require writing custom code and deployments for
each SDK youre using.
</li>
<li>
Differing implementation in each SDK will cause toggles
to evaluate differently
</li>
<li>
Requires a lot of configuration in both Unleash admin UI
and the SDK.
</li>
</ul>
</Paragraph>
<Paragraph>
Constraints dont have these problems. Theyre configured once
in the admin UI and behave in the same way in each SDK without
further configuration.
</Paragraph>
</>
);
if (alert) {
return (
<Alert
severity="info"
sx={theme => ({
marginBottom: theme.spacing(3),
})}
>
{content}
</Alert>
);
}
return (
<Box
sx={theme => ({
maxWidth: '720px',
padding: theme.spacing(4, 2),
margin: '0 auto',
})}
>
{content}
</Box>
);
};