export function getUserTypeOfActivity(userRoles) {
  const poultryRoles = [
    "CityOperator",
    "Poultry",
    "ProvinceOperator",
    "KillHouse",
    "KillHouseVet",
    "VetFarm",
    "ProvinceFinancial",
    "ProvinceInspector",
    "VetSupervisor",
    "Commerce",
    "CityCommerce",
    "CityVet",
    "CityJahad",
    "Observatory",
    "ProvinceSupervisor",
    "Guilds",
    "GuildRoom",
    "LiveStockSupport",
    "SuperAdmin",
    "ChainCompany",
    "AdminX",
    "Supporter",
    "Dispenser",
    "CityPoultry",
    "ParentCompany",
    "ColdHouseSteward",
    "PosCompany",
  ];

  const liveStockRoles = [
    "LiveStockProvinceJahad",
    "Union",
    "Cooperative",
    "Rancher",
  ];

  const isPoultry = userRoles?.some((role) => poultryRoles?.includes(role));

  const isLiveStock = userRoles?.some((role) => liveStockRoles?.includes(role));

  if (isPoultry && isLiveStock) {
    return "Both";
  } else if (isPoultry) {
    return "Poultry";
  } else if (isLiveStock) {
    return "LiveStock";
  } else {
    return "";
  }
}

export function getLiveStockRoles(userRoles) {
  const liveStockRoles = [
    "LiveStockProvinceJahad",
    "Union",
    "Cooperative",
    "Rancher",
  ];

  return userRoles.filter((role) => liveStockRoles.includes(role));
}

export function getBarSquareRoles(userRoles) {
  const liveStockRoles = ["BarSquareProvinceJahad"];

  return userRoles.filter((role) => liveStockRoles.includes(role));
}

export function getPoultryRoles(userRoles) {
  const poultryRoles = [
    "CityOperator",
    "Poultry",
    "ProvinceOperator",
    "KillHouse",
    "KillHouseVet",
    "VetFarm",
    "ProvinceFinancial",
    "ProvinceInspector",
    "VetSupervisor",
    "Commerce",
    "CityCommerce",
    "CityVet",
    "CityJahad",
    "Observatory",
    "ProvinceSupervisor",
    "Guilds",
    "GuildRoom",
    "LiveStockSupport",
    "SuperAdmin",
    "ChainCompany",
    "AdminX",
    "Supporter",
    "Dispenser",
    "CityPoultry",
    "ParentCompany",
    "ColdHouseSteward",
    "PosCompany",
    "Steward",
  ];

  return userRoles.filter((role) => poultryRoles.includes(role));
}
