import { useState } from "react"; import { useGame } from "../../context/GameContext.js"; import { ResourceBar } from "../ui/ResourceBar.js"; import { AboutPanel } from "./AboutPanel.js"; import { AchievementPanel } from "./AchievementPanel.js"; import { AchievementToast } from "./AchievementToast.js"; import { AdventurerPanel } from "./AdventurerPanel.js"; import { BattleModal } from "./BattleModal.js"; import { BossPanel } from "./BossPanel.js"; import { ClickArea } from "./ClickArea.js"; import { CodexPanel } from "./CodexPanel.js"; import { CodexToast } from "./CodexToast.js"; import { EditProfileModal } from "./EditProfileModal.js"; import { EquipmentPanel } from "./EquipmentPanel.js"; import { OfflineModal } from "./OfflineModal.js"; import { PrestigePanel } from "./PrestigePanel.js"; import { ApotheosisPanel } from "./ApotheosisPanel.js"; import { TranscendencePanel } from "./TranscendencePanel.js"; import { QuestPanel } from "./QuestPanel.js"; import { StatisticsPanel } from "./StatisticsPanel.js"; import { UpgradePanel } from "./UpgradePanel.js"; import { DailyChallengePanel } from "./DailyChallengePanel.js"; import { ExplorationPanel } from "./ExplorationPanel.js"; import { CharacterSheetPanel } from "./CharacterSheetPanel.js"; import { CraftingPanel } from "./CraftingPanel.js"; type Tab = "adventurers" | "upgrades" | "quests" | "bosses" | "equipment" | "achievements" | "prestige" | "transcendence" | "apotheosis" | "statistics" | "daily" | "codex" | "about" | "exploration" | "crafting" | "character"; const BASE_TABS: { id: Tab; label: string }[] = [ { id: "adventurers", label: "βš”οΈ Adventurers" }, { id: "upgrades", label: "πŸ”§ Upgrades" }, { id: "quests", label: "πŸ“œ Quests" }, { id: "bosses", label: "πŸ‘Ή Bosses" }, { id: "equipment", label: "πŸ—‘οΈ Equipment" }, { id: "exploration", label: "πŸ—ΊοΈ Exploration" }, { id: "crafting", label: "βš—οΈ Crafting" }, { id: "daily", label: "πŸ“… Daily" }, { id: "prestige", label: "⭐ Prestige" }, { id: "transcendence", label: "🌌 Transcendence" }, { id: "apotheosis", label: "✨ Apotheosis" }, { id: "statistics", label: "πŸ“Š Statistics" }, { id: "character", label: "πŸ“‹ Character" }, { id: "achievements", label: "πŸ† Achievements" }, { id: "codex", label: "πŸ“– Codex" }, { id: "about", label: "ℹ️ About" }, ]; export const GameLayout = (): React.JSX.Element => { const { state, isLoading, error, battleResult, dismissBattle, lastSavedAt, isSyncing, forceSync, newCodexEntryIds } = useGame(); const [activeTab, setActiveTab] = useState("adventurers"); const [editingProfile, setEditingProfile] = useState(false); if (isLoading) { return (

Loading your adventure...

); } if (error) { return (

Error: {error}

); } if (!state) return

Loading...

; const profileUrl = `/profile/${state.player.discordId}`; return (
{ setEditingProfile(true); }} lastSavedAt={lastSavedAt} isSyncing={isSyncing} onForceSync={forceSync} /> {battleResult && ( )} {editingProfile && ( { setEditingProfile(false); }} /> )}
{activeTab === "adventurers" && } {activeTab === "upgrades" && } {activeTab === "quests" && } {activeTab === "bosses" && } {activeTab === "equipment" && } {activeTab === "achievements" && } {activeTab === "prestige" && } {activeTab === "transcendence" && } {activeTab === "apotheosis" && } {activeTab === "exploration" && } {activeTab === "crafting" && } {activeTab === "statistics" && } {activeTab === "daily" && } {activeTab === "character" && } {activeTab === "codex" && } {activeTab === "about" && }
); };