/**
 * Sidebar 状态机：State 形状 + 初始值
 *
 * 枚举 `SidebarPage` / `BottomNavItem` 与 state 形状强相关（`currentPage` /
 * `selectedBottomNavItem` 字段的取值集合），因此与 state 同源定义在本文件，
 * 避免与 `sidebar-machine.ts` 形成循环引用。
 */

/** 页面枚举（侧边栏主区域可显示的页面） */
export const SidebarPage = {
  DefaultView: "defaultView",
  Profile: "profile",
  Topics: "topics",
  Gifts: "gifts",
  Activities: "activities",
} as const;

export type SidebarPage = (typeof SidebarPage)[keyof typeof SidebarPage];

/** 底部导航枚举（选中态） */
export const BottomNavItem = {
  None: "none",
  Topics: "topics",
  Gifts: "gifts",
  Activities: "activities",
} as const;

export type BottomNavItem = (typeof BottomNavItem)[keyof typeof BottomNavItem];

export interface SidebarState {
  currentPage: SidebarPage;
  selectedBottomNavItem: BottomNavItem;
  characterName: string;
  characterProgress: number;
}

export const initialState: SidebarState = {
  currentPage: SidebarPage.DefaultView,
  selectedBottomNavItem: BottomNavItem.None,
  characterName: "Luna",
  characterProgress: 0,
};
