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_USER_CHANGE_BANK_ACCOUNT,
  ROUTE_USER_CHANGE_PASSWORD,
  ROUTE_USER_CHANGE_PROFILE_INFO,
  ROUTE_USER_CHANGE_PROFILE_PICTURE,
  ROUTE_USER_PROFILE,
} from "../../../../routes/routes";

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

  return (
    <Grid
      container
      gap={SPACING.SMALL}
      p={SPACING.SMALL}
      direction={{ xs: "column", md: "row" }}
    >
      <NavLink
        to={ROUTE_USER_PROFILE}
        active={
          pathname === ROUTE_USER_PROFILE || pathname === "/" ? "true" : null
        }
      >
        <Button variant="text" color="inherit">
          پروفایل کاربری
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_USER_CHANGE_PASSWORD}
        active={pathname === ROUTE_USER_CHANGE_PASSWORD ? "true" : null}
      >
        <Button variant="text" color="inherit">
          تغییر رمز عبور
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_USER_CHANGE_PROFILE_PICTURE}
        active={pathname === ROUTE_USER_CHANGE_PROFILE_PICTURE ? "true" : null}
      >
        <Button variant="text" color="inherit">
          تغییر عکس پروفایل
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_USER_CHANGE_PROFILE_INFO}
        active={pathname === ROUTE_USER_CHANGE_PROFILE_INFO ? "true" : null}
      >
        <Button variant="text" color="inherit">
          تغییر مشخصات پروفایل
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_USER_CHANGE_BANK_ACCOUNT}
        active={pathname === ROUTE_USER_CHANGE_BANK_ACCOUNT ? "true" : null}
      >
        <Button variant="text" color="inherit">
          تغییر اطلاعات حساب بانکی
        </Button>
      </NavLink>
    </Grid>
  );
};
