import type { BottomTab, RunMode } from "./types";
import { isPvpRunMode } from "./runModes";

const STANDARD_BOTTOM_TABS = ["combat", "map", "pack"] as const satisfies readonly BottomTab[];
const PVP_BOTTOM_TABS = ["combat", "map", "pvp"] as const satisfies readonly BottomTab[];

export function bottomTabsFor(runMode: RunMode): readonly BottomTab[] {
  return isPvpRunMode(runMode) ? PVP_BOTTOM_TABS : STANDARD_BOTTOM_TABS;
}

export function cycleBottomTab(activeTab: BottomTab, runMode: RunMode): BottomTab {
  const tabs = bottomTabsFor(runMode);
  const currentIndex = tabs.indexOf(activeTab);
  return tabs[(currentIndex + 1) % tabs.length];
}
