import { LanguageTypes } from "@/validations/mutual/language/validations";
import { ParamsType } from "@/validations/mutual/pages/props";

interface MaindasboardPageProps {
  params: Promise<ParamsType>;
  searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}

interface DashboardLayoutProps {
  params: ParamsType;
  searchParams: { [key: string]: string | string[] | undefined };
  lang: LanguageTypes;
}

type ModeTypes = "shortList" | "fullList" | "create" | "update" | "view";
const ModeTypesList = ["shortList", "fullList", "create", "update", "view"];

interface ContentProps {
  activePageUrl: string;
  mode?: ModeTypes;
  searchParams: Record<string, any>;
  onlineData: any;
  onlineLoading: boolean;
  onlineError: any;
  refreshOnline: () => Promise<void>;
  updateOnline: (newOnline: any) => Promise<boolean>;
  userData: any;
  userLoading: boolean;
  userError: any;
  refreshUser: () => Promise<void>;
  updateUser: (newUser: any) => Promise<boolean>;
}

interface MenuProps {
  availableApplications: string[];
  searchParams: Record<string, any>;
  activePageUrl: string;
  prefix?: string;
  onlineData: any;
  onlineLoading: boolean;
  onlineError: any;
  refreshOnline: () => Promise<void>;
  updateOnline: (newOnline: any) => Promise<boolean>;
  userData: any;
  userLoading: boolean;
  userError: any;
  refreshUser: () => Promise<void>;
  updateUser: (newUser: any) => Promise<boolean>;
  selectionData: any;
  selectionLoading: boolean;
  selectionError: any;
  refreshSelection: () => Promise<void>;
  updateSelection: (newSelection: any) => Promise<boolean>;
  menuData: any;
  menuLoading: boolean;
  menuError: any;
  refreshMenu: () => Promise<void>;
  updateMenu: (newMenu: any) => Promise<boolean>;
}

interface FooterProps {
  searchParams: Record<string, any>;
  activePageUrl: string;
  configData: any;
  configLoading: boolean;
  configError: any;
  refreshConfig: () => Promise<void>;
  updateConfig: (newConfig: any) => Promise<boolean>;
  onlineData: any;
  onlineLoading: boolean;
  onlineError: any;
  refreshOnline: () => Promise<void>;
  updateOnline: (newOnline: any) => Promise<boolean>;
}

interface HeaderProps {
  activePageUrl: string;
  searchParams: Record<string, any>;
  onlineData: any;
  onlineLoading: boolean;
  onlineError: any;
  refreshOnline: () => Promise<void>;
  updateOnline: (newOnline: any) => Promise<boolean>;
  userData: any;
  userLoading: boolean;
  userError: any;
  refreshUser: () => Promise<void>;
  updateUser: (newUser: any) => Promise<boolean>;
}

export type {
  MaindasboardPageProps,
  DashboardLayoutProps,
  ContentProps,
  MenuProps,
  FooterProps,
  HeaderProps,
  ModeTypes,
};

export { ModeTypesList };
