import {
  Button,
  Dialog,
  DialogTitle,
  DialogActions,
  DialogContent,
} from '@material-ui/core';

export const Modal = ({
  open,
  close,
  submit,
  title,
  children,
}) => {
  return (
    <Dialog
      open={open}
      onClose={close}
    >
      <DialogTitle id="alert-dialog-title">
        {title}
      </DialogTitle>
      <DialogContent>
        {children}
      </DialogContent>
      <DialogActions>
        <Button
          onClick={close}
        >
          Cancel
        </Button>
        <Button
          variant="contained"
          color="secondary"
          onClick={submit}
          autoFocus
        >
          Submit
        </Button>
      </DialogActions>
    </Dialog>
  )
}