import { VscComment, VscNewFolder } from "react-icons/vsc";
import { useLocation } from "react-router-dom";
import { Grid } from "../../../../components/grid/Grid";
import LinkItem from "../../../../components/link-item/LinkItem";
import { NavLink } from "../../../../components/nav-link/NavLink";
import { SPACING } from "../../../../data/spacing";
import {
  ROUTE_ADMINX_ROUTE_ACCOUNTS,
  ROUTE_ADMINX_ROUTE_CRONJOB,
  ROUTE_ADMINX_ROUTE_Sms_Submission_Management,
  ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES,
  ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,
  ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS,
  ROUTE_ADMINX_ROUTE_TICKET_PERMISSION,
  ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,
  ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES,
  ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL,
  ROUTE_SUPER_ADMIN_ROUTE_TICKET_PERMISSION,
  ROUTE_ADMINX_ROUTE_WEIGHT_RANGE,
  ROUTE_ADMINX_ROUTE_WEIGHT_CATEGORY,
  ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_RANGE,
  ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_CATEGORY,
  ROUTE_SUPER_ADMIN_ROUTE_PENALTY,
  ROUTE_ADMINX_ROUTE_PENALTY,
  ROUTE_ADMINX_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION,
  ROUTE_SUPER_ADMIN_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION,
  // ROUTE_SUPER_ADMIN_ROUTE_PENALTY,
  // ROUTE_ADMINX_ROUTE_PENALTY,
} from "../../../../routes/routes";
import { getRoleFromUrl } from "../../../../utils/getRoleFromUrl";
import { VscGripper } from "react-icons/vsc";
import {
  FaDollarSign,
  FaFile,
  FaMoneyBill,
  FaPercent,
  FaSms,
  FaWeight,
  FaBan,
  // FaDollarSign,
} from "react-icons/fa";
export const ProvinceManageProcessOperation = () => {
  const { pathname } = useLocation();

  return (
    <Grid
      container
      gap={SPACING.SMALL}
      // p={SPACING.SMALL}
      direction={"row"}
      mt={SPACING.MEDIUM}
      justifyContent={{ xs: "center", lg: "flex-start" }}
      // style={{ placeContent: "baseline" }}
      xs={12}
    >
      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL
            : getRoleFromUrl() === "AdminX"
            ? ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL
            : ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL
        }
        active={
          pathname === ROUTE_PROVINCE_ROUTE_MANAGE_PROCESS_POLICY_COUNCIL
            ? "true"
            : null
        }
      >
        <LinkItem
          icon={<VscNewFolder size={30} color="#244CCC" />}
          title="شورای سیاست گذاری"
        />
      </NavLink>

      {getRoleFromUrl() === "AdminX" && (
        <NavLink
          to={
            getRoleFromUrl() === "AdminX"
              ? ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS
              : ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS
          }
          active={
            pathname === ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_WAGE_FRACTIONS
              ? "true"
              : null
          }
        >
          <LinkItem
            icon={<VscGripper size={30} color="#244CCC" />}
            title="سهم بندی"
          />
        </NavLink>
      )}

      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES
            : ROUTE_ADMINX_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES
        }
        active={
          pathname === ROUTE_SUPER_ADMIN_ROUTE_MANAGE_PROCESS_DOCUMENT_STATES
            ? "true"
            : null
        }
      >
        <LinkItem
          icon={<FaFile size={30} color="#244CCC" />}
          title="وضعیت اسناد"
        />
      </NavLink>
      {getRoleFromUrl() === "AdminX" && (
        <NavLink
          to={ROUTE_ADMINX_ROUTE_ACCOUNTS}
          active={pathname === ROUTE_ADMINX_ROUTE_ACCOUNTS ? "true" : null}
        >
          <LinkItem
            icon={<FaMoneyBill size={30} color="#244CCC" />}
            title="حساب ها"
          />
        </NavLink>
      )}
      {(getRoleFromUrl() === "AdminX" || getRoleFromUrl() === "SuperAdmin") && (
        <NavLink
          to={
            getRoleFromUrl() === "AdminX"
              ? ROUTE_ADMINX_ROUTE_TICKET_PERMISSION
              : ROUTE_SUPER_ADMIN_ROUTE_TICKET_PERMISSION
          }
          active={
            pathname === ROUTE_ADMINX_ROUTE_TICKET_PERMISSION ? "true" : null
          }
        >
          <LinkItem
            icon={<VscComment size={30} color="#244CCC" />}
            title="مدیریت ارسال تیکت"
          />
        </NavLink>
      )}
      {getRoleFromUrl() === "AdminX" && (
        <NavLink
          to={
            getRoleFromUrl() === "AdminX"
              ? ROUTE_ADMINX_ROUTE_CRONJOB
              : ROUTE_ADMINX_ROUTE_CRONJOB
          }
          active={pathname === ROUTE_ADMINX_ROUTE_CRONJOB ? "true" : null}
        >
          <LinkItem
            icon={<VscComment size={30} color="#244CCC" />}
            title="کرونجاب"
          />
        </NavLink>
      )}

      {getRoleFromUrl() === "AdminX" && (
        <NavLink
          to={
            getRoleFromUrl() === "AdminX"
              ? ROUTE_ADMINX_ROUTE_Sms_Submission_Management
              : ROUTE_ADMINX_ROUTE_Sms_Submission_Management
          }
          active={
            pathname === ROUTE_ADMINX_ROUTE_Sms_Submission_Management
              ? "true"
              : null
          }
        >
          <LinkItem
            icon={<FaSms size={30} color="#244CCC" />}
            title="مدیریت ارسال پیامک"
          />
        </NavLink>
      )}
      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_RANGE
            : ROUTE_ADMINX_ROUTE_WEIGHT_RANGE
        }
        active={pathname === ROUTE_ADMINX_ROUTE_WEIGHT_RANGE ? "true" : null}
      >
        <LinkItem
          icon={<FaPercent size={30} color="#244CCC" />}
          title="مدیریت بازه وزنی"
        />
      </NavLink>

      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_WEIGHT_CATEGORY
            : ROUTE_ADMINX_ROUTE_WEIGHT_CATEGORY
        }
        active={pathname === ROUTE_ADMINX_ROUTE_WEIGHT_CATEGORY ? "true" : null}
      >
        <LinkItem
          icon={<FaWeight size={30} color="#244CCC" />}
          title="دسته بندی وزنی"
        />
      </NavLink>
      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_PENALTY
            : ROUTE_ADMINX_ROUTE_PENALTY
        }
        active={pathname === ROUTE_ADMINX_ROUTE_PENALTY ? "true" : null}
      >
        <LinkItem
          icon={<FaDollarSign size={30} color="#244CCC" />}
          title="جریمه"
        />
      </NavLink>
      <NavLink
        to={
          getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION
            : ROUTE_ADMINX_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION
        }
        active={
          pathname === ROUTE_ADMINX_ROUTE_RESTRICTION_OF_CARCASS_DISTRIBUTION
            ? "true"
            : null
        }
      >
        <LinkItem
          icon={<FaBan size={30} color="#244CCC" />}
          title="محدودیت توزیع لاشه"
        />
      </NavLink>
    </Grid>
  );
};
