import { Box } from "@mui/system";
import { Grid } from "../components/grid/Grid";
import { SPACING } from "../data/spacing";
import SlaughterAgentShare from "../pages/SlaughterAgentShare";
import { BroadcastManagementOperations } from "../features/province/components/broadcast-management-operations/BroadcastManagementOperations";
import {
  ROUTE_ADMINX_BROADCAST_MANAGEMENT,
  ROUTE_ADMINX_ROUTE_AGENT_SHARE,
  ROUTE_PROVINCE_ROUTE_AGENT_SHARE,
  ROUTE_PROVINCEـBROADCAST_MANAGEMENT,
  ROUTE_SUPER_ADMIN_BROADCAST_MANAGEMENT,
  ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE,
} from "../routes/routes";
import { useLocation } from "react-router-dom";

const BroadcastManagement = () => {
  const { pathname } = useLocation();

  return (
    <Box display={"flex"} justifyContent="center">
      <Grid
        container
        direction="column"
        justifyContent="center"
        my={SPACING.MEDIUM}
        xs={12}
        sm={12}
        md={10}
        lg={10}
      >
        {(pathname === ROUTE_PROVINCEـBROADCAST_MANAGEMENT ||
          pathname === ROUTE_SUPER_ADMIN_BROADCAST_MANAGEMENT ||
          pathname === ROUTE_ADMINX_BROADCAST_MANAGEMENT) && (
          <BroadcastManagementOperations />
        )}

        {(pathname === ROUTE_PROVINCE_ROUTE_AGENT_SHARE ||
          pathname === ROUTE_SUPER_ADMIN_ROUTE_AGENT_SHARE ||
          pathname === ROUTE_ADMINX_ROUTE_AGENT_SHARE) && (
          <SlaughterAgentShare />
        )}
      </Grid>
    </Box>
  );
};

export default BroadcastManagement;
