import { Box } from "@mui/material";
import { useLocation } from "react-router-dom";
import { Grid } from "../components/grid/Grid";
import { SPACING } from "../data/spacing";
import { CityHatching } from "../features/city/components/city-new-hatching/CityHatching";
import { CityNewRequest } from "../features/city/components/city-new-request/CityNewRequest";
import {
  ROUTE_ADMINX_HATCHING,
  ROUTE_ADMINX_NEW_REQUEST,
  ROUTE_ADMINX_ROUTE_NATIONAL_INFO,
  ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM,
  ROUTE_CITY_HATCHING,
  ROUTE_CITY_NEW_REQUEST,
  ROUTE_CITY_POULTRY_HATCHING,
  ROUTE_PROVINCE_HATCHING,
  ROUTE_PROVINCE_NEW_REQUEST,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO,
  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM,
  ROUTE_SUPER_ADMIN_HATCHING,
  ROUTE_SUPER_ADMIN_NEW_REQUEST,
  ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO,
  ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM,
  ROUTE_VETFARM_ROUTE_HATCHING,
} from "../routes/routes";
import { ProvinceNationalInfo } from "../features/province/components/province-national-info/ProvinceNationalInfo";
import { ProvinceNationalInfoFarm } from "../features/province/components/province-national-info-farm/ProvinceNationalInfoFarm";

const OperatorNewHatching = () => {
  const { pathname } = useLocation();
  return (
    <>
      <Box display={"flex"} justifyContent="center">
        <Grid
          container
          direction="column"
          justifyContent="center"
          xs={11}
          sm={11}
          md={10}
          lg={10}
        >
          {/* <Grid justifyContent="center" my={SPACING.MEDIUM}>
            <Card>
              <CityHatchingOperations />
            </Card>
          </Grid> */}
          <Grid
            container
            justifyContent="space-between"
            mt={SPACING.MEDIUM}
            gap={SPACING.SMALL}
          >
            <Grid xs={12}>
              {(pathname === ROUTE_CITY_HATCHING ||
                pathname === ROUTE_PROVINCE_HATCHING ||
                pathname === ROUTE_VETFARM_ROUTE_HATCHING ||
                pathname === ROUTE_ADMINX_HATCHING ||
                pathname === ROUTE_CITY_POULTRY_HATCHING ||
                pathname === ROUTE_SUPER_ADMIN_HATCHING) && <CityHatching />}

              {(pathname === ROUTE_CITY_NEW_REQUEST ||
                pathname === ROUTE_PROVINCE_NEW_REQUEST ||
                pathname === ROUTE_ADMINX_NEW_REQUEST ||
                pathname === ROUTE_SUPER_ADMIN_NEW_REQUEST) && (
                <CityNewRequest />
              )}

              {(pathname.includes(ROUTE_ADMINX_ROUTE_NATIONAL_INFO) ||
                pathname.includes(ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO) ||
                pathname.includes(
                  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO
                )) && <ProvinceNationalInfo />}

              {(pathname.includes(ROUTE_ADMINX_ROUTE_NATIONAL_INFO_FARM) ||
                pathname.includes(ROUTE_SUPER_ADMIN_ROUTE_NATIONAL_INFO_FARM) ||
                pathname.includes(
                  ROUTE_PROVINCE_SUPERVISOR_ROUTE_NATIONAL_INFO_FARM
                )) && <ProvinceNationalInfoFarm />}
            </Grid>
          </Grid>
        </Grid>
      </Box>
    </>
  );
};

export default OperatorNewHatching;
