export type AppHeaderConfig = {
  title: string;
  showBack?: boolean;
  backTo?: string;
  action?: "profile" | "settings" | "none";
};

export type AppRouteHandle = {
  header: AppHeaderConfig;
};

export const defaultHeader: AppHeaderConfig = {
  title: "خانه",
  showBack: false,
  action: "profile",
};

export const appTabs = ["/", "/public-chat", "/magic-bag", "/messages", "/profile"] as const;

export function getAppTabIndex(pathname: string): number {
  return appTabs.findIndex((tab) => pathname === tab || (tab !== "/" && pathname.startsWith(`${tab}/`)));
}
