import { Button, Typography } from '@mui/material';

import Dialog from '../../common/Dialog';

interface Props {
  onClose: () => void;
  onDiscardLocal: () => void;
  onPushInNewCommit: () => void;
  open: boolean;
}

export const DivergedDialog = ({ onClose, onDiscardLocal, onPushInNewCommit, open }: Props) => (
  <Dialog
    open={open}
    onClose={onClose}
    title="The remote git repository for this project has changed"
    size="sm"
    fullWidth
    actionButtons={
      <>
        <Button onClick={onClose} variant="outlined" color="inherit">
          Nothing
        </Button>
        <Button onClick={onPushInNewCommit} variant="contained">
          Push local changes in a new commit
        </Button>
        <Button onClick={onDiscardLocal} variant="contained">
          Discard local changes
        </Button>
      </>
    }
  >
    <Typography>
      To ensure we don’t delete any history, CFEngine Build will never force push. What do you want to do?
    </Typography>
  </Dialog>
);
