2022-10-26 13:57:59 +02:00
|
|
|
import { FC } from 'react';
|
2022-10-28 09:37:55 +02:00
|
|
|
import { Alert, Typography } from '@mui/material';
|
2022-10-26 13:57:59 +02:00
|
|
|
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
|
|
|
|
|
|
|
interface ISuggestChangesDialogueProps {
|
|
|
|
isOpen: boolean;
|
|
|
|
onConfirm: () => void;
|
|
|
|
onClose: () => void;
|
|
|
|
featureName?: string;
|
|
|
|
environment?: string;
|
|
|
|
enabled?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const SuggestChangesDialogue: FC<ISuggestChangesDialogueProps> = ({
|
|
|
|
isOpen,
|
|
|
|
onConfirm,
|
|
|
|
onClose,
|
|
|
|
enabled,
|
|
|
|
featureName,
|
|
|
|
environment,
|
2022-10-28 09:37:55 +02:00
|
|
|
}) => (
|
|
|
|
<Dialogue
|
|
|
|
open={isOpen}
|
|
|
|
primaryButtonText="Add to draft"
|
|
|
|
secondaryButtonText="Cancel"
|
|
|
|
onClick={onConfirm}
|
|
|
|
onClose={onClose}
|
|
|
|
title="Suggest changes"
|
|
|
|
>
|
|
|
|
<Alert severity="info" sx={{ mb: 2 }}>
|
|
|
|
Suggest changes is enabled for {environment}. Your changes needs to
|
|
|
|
be approved before they will be live. All the changes you do now
|
|
|
|
will be added into a draft that you can submit for review.
|
|
|
|
</Alert>
|
|
|
|
<Typography variant="body2" color="text.secondary">
|
|
|
|
Suggested changes:
|
|
|
|
</Typography>
|
|
|
|
<Typography>
|
|
|
|
<strong>{enabled ? 'Disable' : 'Enable'}</strong> feature toggle{' '}
|
|
|
|
<strong>{featureName}</strong> in <strong>{environment}</strong>
|
|
|
|
</Typography>
|
|
|
|
</Dialogue>
|
|
|
|
);
|