import Stack from '@mui/material/Stack';
import IconButton from '@mui/material/IconButton';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import { makeStyles, Typography } from '@material-ui/core'
import { useDispatch } from 'react-redux';

import { actionIsOpen } from '../../../../../../../redux/control/action'

const useStyles = makeStyles({
  container: {
    paddingLeft: 10,
    paddingBottom: 3,
    width: 482,
    display: 'flex',
    alignContent: 'center',
    alignItems: 'center',
  },
  iconArrow: {
    '&:hover': {
      transform: 'rotate(360deg)',
      transition: 'all 250ms ease-out ',
    }
  },
})

const ToolBar = () => {
  const dispatch = useDispatch()
  const classes = useStyles()

  return (
    <Stack className={classes.container} direction="row" spacing={21}>
      <IconButton onClick={() => dispatch(actionIsOpen('credentials'))} aria-label="delete" size="medium">
        <ArrowBackIcon className={classes.iconArrow} fontSize='medium'/>
      </IconButton>
      <Typography style={{marginLeft:20,color: '#474747'}} variant="h6" color="initial">Edit</Typography>
    </Stack>
    )
}

export default ToolBar