import { useLocation } from "react-router-dom";
import { Button } from "@mui/material";
import {
  ROUTE_ADMIN_ARCHIVED_REQUESTS,
  ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS,
  ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS,
  ROUTE_ADMIN_HATCHING,
  ROUTE_ADMIN_REJECTED_REQUESTS,
  ROUTE_ADMIN_REQUESTS,
} from "../../../../routes/routes";
import { Grid } from "../../../../components/grid/Grid";
import { SPACING } from "../../../../data/spacing";
import { NavLink } from "../../../../components/nav-link/NavLink";

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

  return (
    <Grid
      container
      gap={SPACING.SMALL}
      p={SPACING.SMALL}
      direction={{ xs: "column", md: "row" }}
    >
      <NavLink
        to={ROUTE_ADMIN_HATCHING}
        active={pathname === ROUTE_ADMIN_HATCHING ? "true" : null}
      >
        <Button variant="text" color="inherit">
          ثبت اطلاعات جوجه ریزی
        </Button>
      </NavLink>

      <NavLink
        to={ROUTE_ADMIN_REQUESTS}
        active={pathname === ROUTE_ADMIN_REQUESTS ? "true" : null}
      >
        <Button variant="text" color="inherit">
          ثبت درخواست کشتار
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS}
        active={
          pathname === ROUTE_ADMIN_AWAITING_PAYMENT_REQUESTS ? "true" : null
        }
      >
        <Button variant="text" color="inherit">
          در انتظار پرداخت
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS}
        active={
          pathname === ROUTE_ADMIN_AWAITING_INSPECTION_REQUESTS ? "true" : null
        }
      >
        <Button variant="text" color="inherit">
          در انتظار بازرسی
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_ADMIN_REJECTED_REQUESTS}
        active={pathname === ROUTE_ADMIN_REJECTED_REQUESTS ? "true" : null}
      >
        <Button variant="text" color="inherit">
          سفارشات رد شده
        </Button>
      </NavLink>
      <NavLink
        to={ROUTE_ADMIN_ARCHIVED_REQUESTS}
        active={pathname === ROUTE_ADMIN_ARCHIVED_REQUESTS ? "true" : null}
      >
        <Button variant="text" color="inherit">
          سفارشات بایگانی شده
        </Button>
      </NavLink>
    </Grid>
  );
};
