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 {
  ROUTE_ADMINX_COMPANY_ROUTE_ACTIVE_SESSION,
  ROUTE_ADMINX_COMPANY_ROUTE_DEVICES,
  ROUTE_ADMINX_ROUTE_DEVICES_V2,
  ROUTE_PSP_COMPANY_ROUTE_ACTIVE_SESSION,
  ROUTE_PSP_COMPANY_ROUTE_DEVICES,
  ROUTE_PSP_COMPANY_ROUTE_DEVICES_V2,
  ROUTE_SUPER_ADMIN_COMPANY_ROUTE_ACTIVE_SESSION,
  ROUTE_SUPER_ADMIN_COMPANY_ROUTE_DEVICES,
  ROUTE_SUPER_ADMIN_ROUTE_DEVICES_V2,
  // ROUTE_PSP_COMPANY_ROUTE_GUILDS,
} from "../../../../routes/routes";
import LinkItem from "../../../../components/link-item/LinkItem";
// import { MdCorporateFare } from "react-icons/md";
import { FaFax, FaMobileAlt } from "react-icons/fa";
import { getRoleFromUrl } from "../../../../utils/getRoleFromUrl";
export const PspOperations = () => {
  const { pathname } = useLocation();

  return (
    <Grid
      container
      gap={SPACING.SMALL}
      p={SPACING.SMALL}
      direction={{ xs: "column", md: "row" }}
      justifyContent="center"
    >
      <NavLink
        to={
          getRoleFromUrl() === "PosCompany"
            ? ROUTE_PSP_COMPANY_ROUTE_DEVICES_V2
            : getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_ROUTE_DEVICES_V2
            : getRoleFromUrl() === "AdminX"
            ? ROUTE_ADMINX_ROUTE_DEVICES_V2
            : null
        }
        active={
          getRoleFromUrl() === "PosCompany"
            ? pathname === ROUTE_PSP_COMPANY_ROUTE_DEVICES_V2
            : getRoleFromUrl() === "SuperAdmin"
            ? pathname === ROUTE_SUPER_ADMIN_ROUTE_DEVICES_V2
            : getRoleFromUrl() === "AdminX"
            ? pathname === ROUTE_ADMINX_ROUTE_DEVICES_V2
            : null
        }
      >
        <LinkItem
          icon={<FaFax size={30} color="#244CCC" />}
          title="دستگاه‌ها دوم"
        />
      </NavLink>
      <NavLink
        to={
          getRoleFromUrl() === "PosCompany"
            ? ROUTE_PSP_COMPANY_ROUTE_DEVICES
            : getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_COMPANY_ROUTE_DEVICES
            : getRoleFromUrl() === "AdminX"
            ? ROUTE_ADMINX_COMPANY_ROUTE_DEVICES
            : ""
        }
        active={
          getRoleFromUrl() === "PosCompany"
            ? pathname === ROUTE_PSP_COMPANY_ROUTE_DEVICES
            : getRoleFromUrl() === "SuperAdmin"
            ? pathname === ROUTE_SUPER_ADMIN_COMPANY_ROUTE_DEVICES
            : getRoleFromUrl() === "AdminX"
            ? pathname === ROUTE_ADMINX_COMPANY_ROUTE_DEVICES
            : null
        }
      >
        <LinkItem
          icon={<FaFax size={30} color="#244CCC" />}
          title="دستگاه ها"
        />
      </NavLink>
      {/* <NavLink
          to={ROUTE_PSP_COMPANY_ROUTE_GUILDS}
          active={pathname === ROUTE_PSP_COMPANY_ROUTE_GUILDS ? "true" : null}
        >
          <LinkItem
            icon={<MdCorporateFare size={30} color="#244CCC" />}
            title="اصناف"
          />
        </NavLink> */}
      <NavLink
        to={
          getRoleFromUrl() === "PosCompany"
            ? ROUTE_PSP_COMPANY_ROUTE_ACTIVE_SESSION
            : getRoleFromUrl() === "SuperAdmin"
            ? ROUTE_SUPER_ADMIN_COMPANY_ROUTE_ACTIVE_SESSION
            : getRoleFromUrl() === "AdminX"
            ? ROUTE_ADMINX_COMPANY_ROUTE_ACTIVE_SESSION
            : null
        }
        active={
          getRoleFromUrl() === "PosCompany"
            ? pathname === ROUTE_PSP_COMPANY_ROUTE_ACTIVE_SESSION
            : getRoleFromUrl() === "SuperAdmin"
            ? pathname === ROUTE_SUPER_ADMIN_COMPANY_ROUTE_ACTIVE_SESSION
            : getRoleFromUrl() === "AdminX"
            ? pathname === ROUTE_ADMINX_COMPANY_ROUTE_ACTIVE_SESSION
            : null
        }
      >
        <LinkItem
          icon={<FaMobileAlt size={30} color="#244CCC" />}
          title="نشست های فعال"
        />
      </NavLink>
    </Grid>
  );
};
