import { Grid } from "../../../../components/grid/Grid";
import { SPACING } from "../../../../data/spacing";
import { NavLink } from "../../../../components/nav-link/NavLink";
import { useLocation } from "react-router-dom";
import { Button } from "@mui/material";
import {
  ROUTE_DRIVER_CARS,
  ROUTE_DRIVER_REQUESTS,
} from "../../../../routes/routes";

export const DriverOperations = () => {
  const { pathname } = useLocation();

  return (
    <Grid
      container
      gap={SPACING.SMALL}
      p={SPACING.SMALL}
      direction={{ xs: "column", md: "row" }}
    >
      <NavLink
        to={ROUTE_DRIVER_REQUESTS}
        active={pathname === ROUTE_DRIVER_REQUESTS ? "true" : null}
      >
        <Button variant="text" color="inherit">
          درخواست های شما
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_DRIVER_CARS}
        active={pathname === ROUTE_DRIVER_CARS ? "true" : null}
      >
        <Button variant="text" color="inherit">
          ماشین های شما
        </Button>
      </NavLink>
    </Grid>
  );
};
