import { FC } from 'react'; import { Alert, Box, Typography } from '@mui/material'; import { Dialogue } from 'component/common/Dialogue/Dialogue'; import useToast from 'hooks/useToast'; import { formatUnknownError } from 'utils/formatUnknownError'; interface ISuggestChangesDialogueProps { isOpen: boolean; onConfirm: () => void; onClose: () => void; featureName?: string; environment?: string; enabled?: boolean; } export const SuggestChangesDialogue: FC = ({ isOpen, onConfirm, onClose, enabled, featureName, environment, }) => { const { setToastData, setToastApiError } = useToast(); const onSuggestClick = async () => { try { alert('Suggesting changes'); onConfirm(); } catch (error: unknown) { setToastApiError(formatUnknownError(error)); } }; return ( 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. Suggested changes: {enabled ? 'Disable' : 'Enable'} feature toggle{' '} {featureName} in {environment} ); };