import { IconButton, Typography } from "@mui/material";
import { useNavigate } from "react-router-dom";
import { Grid } from "../grid/Grid";
import { SPACING } from "../../data/spacing";
import StartIcon from "@mui/icons-material/Start";

export const BackButton = () => {
  const navigate = useNavigate();
  return (
    <Grid container alignItems="center" my={SPACING.SMALL}>
      <IconButton
        aria-label="delete"
        color="primary"
        onClick={() => navigate(-1)}
      >
        <StartIcon />
        <Typography mx={1}>بازگشت</Typography>
      </IconButton>
    </Grid>
  );
};
