text: import { withStyles } from '@material-ui/core/styles';
  import Dialog from '@material-ui/core/Dialog';
  import MuiDialogTitle from '@material-ui/core/DialogTitle';
  import MuiDialogContent from '@material-ui/core/DialogContent';
  import IconButton from '@material-ui/core/IconButton';
  import CloseIcon from '@material-ui/icons/Close';
  import Typography from '@material-ui/core/Typography';
  
  
  import React, {  useEffect } from 'react';
  import { connect } from 'react-redux';
  import store from 'index';
  
  const styles = (theme) => ({
    root: {
      margin: 0,
      padding: theme.spacing(2),
    },
    closeButton: {
      position: 'absolute',
      right: theme.spacing(1),
      top: theme.spacing(1),
      color: theme.palette.grey[500],
    },
  });
  
  
  
  const DialogContent = withStyles((theme) => ({
    root: {
      padding: theme.spacing(2),
    },
  }))(MuiDialogContent);
  
  /*
  const DialogActions = withStyles((theme) => ({
    root: {
      margin: 0,
      padding: theme.spacing(1),
    },
  }))(MuiDialogActions);
  */
  
  
  
  
   function EditdialogWorkflow({children}) {
    const [open, setOpen] = React.useState(false);
  
  
    useEffect(() => {
      
      store.subscribe(()=>{
        if (store.getState().Add.flag1){
          setOpen(false);
        }
      })
    });
  
    const DialogTitle = withStyles(styles)((props) => {
      const { children, classes, onClose,num, ...other } = props;
      return (
        <MuiDialogTitle disableTypography className={classes.root} {...other}>
          <Typography variant="h6">{children}</Typography>
          {onClose ? (
            <IconButton aria-label="close" className={classes.closeButton} onClick={onClose}>
              <CloseIcon />
            </IconButton>
          ) : null}
        </MuiDialogTitle>
      );
    });
  
    const handleClickOpen = () => {
      setOpen(true);
    };
    
    const handleClose = () => {
      setOpen(false);
    };
  
    
  
    return (
      <div >
      <button type="button" className="btn btn-info edit btn-block" onClick={handleClickOpen}>Edit </button>
      <Dialog onClose={handleClose} aria-labelledby="customized-dialog-title" open={open}>
          <DialogTitle id="customized-dialog-title" onClose={handleClose}>
           Edit this folder
          </DialogTitle>
          <DialogContent dividers>
            {children}
          </DialogContent>
         
        </Dialog>
        
      </div>
    );
  }
  
  const mapStateToProps=(state)=>{
    return {
        folder:state.Add.folder
    }
  }
  
  export default connect(mapStateToProps,null)(EditdialogWorkflow)
  
  