import { Id, JsonObject } from '@win2win/shared';

export interface LayoutConfig {
  menu: MenuConfig;
  home: Partial<HomeConfig>;
  login: Partial<LoginConfig>;
  toolbar: Partial<ToolbarConfig>;
  footer: JsonObject;
  styles: string[];
}

export interface MenuRoleGroup {
  ca: number[];
  menu_header: MenuItem[];
  menu_footer: MenuItem[];
}

export interface MenuItem {
  label: string;
  icon: string;
  to: string;
  variant: string;
  mobile: boolean;
  desktop: boolean;
  ca: number;
  items: MenuItem[];
  campaign?: string;
}

export interface LoginConfig {
  title: string;
  header: {
    style: string;
    imageUrl: string;
  };
  footer: {
    imageUrl: string;
    text: string;
    showYear: boolean;
  };
  hero: {
    imageUrl: string;
    textColor: string;
    textBg: string;
    text: string;
  };
  tabs: {
    color: string;
  };
}

export interface HomeItem {
  id?: `${Id}` | null;
  mobile: string;
  desktop: string;
}

export type MenuConfig = MenuRoleGroup[];
export type HomeConfig = Record<`${Id}`, HomeItem>;

export interface ToolbarConfig {
  elevated: boolean;
  color: string;
  logo: {
    url: string;
    height: string;
  };
  mobile: {
    color: string;
  };
}
