import type {TileRecord} from "ucsd-its-frontend";
import {useAppStore} from "../stores/app";
import type {UcsdConfig} from "ucsd-its-frontend";
/**
 * Configuration object for the UCSD Application.
 *
 * Provides details related to the application layout, menus, themes, and default settings.
 * Supports nested menu structures and dynamic behaviors.
 *
 * @type {object}
 * @property {string} defaultLayout - The default layout type for the application. Possible values include 'Floating' or other layout types defined in the application.
 * @property {string} defaultPageHdr - The default page header text for the application.
 * @property {string} defaultSubHdr - The default sub-header text for the application.
 * @property {string} defaultTheme - The default theme for the application, e.g., 'dark'.
 * @property {TileRecord} rootMenu - The root-level menu configuration, containing metadata such as label, value, icon, etc.
 * @property {Array.<TileRecord>} menus - A list of menu items and their hierarchies. Each menu item can have nested children, actions, links, icons, and dynamic behaviors.
 */
export const ucsdAppConfig : UcsdConfig = {
    defaultLayout: 'Fixed',
    defaultPageHdr: 'Main Title',
    defaultSubHdr: 'Sub Title',
    initCallback : () => useAppStore().initializeStore(),
    loginCallback: () => useAppStore().fetchRoles(),
    defaultTheme: 'dark',
    rootMenu : {
        label: 'Home',
        key : '0-0',
        icon : 'mdi-home',
        disabled: false,
        buttonColor: 'purple',
        link: '/',
        active: true,
        children: []
    } as TileRecord,
    menus:  [
        {
            label: 'Customer',
            key : '0-1',
            icon : 'mdi-account',
            disabled: false,
            buttonColor: 'purple',
            link: '/customer/home',
            active: false,
            children: [
                {
                    label: 'Search Customer',
                    key : '0-1-0',
                    icon : 'mdi-magnify',
                    disabled: false,
                    buttonColor: 'purple',
                    link: '/customer/search',
                    active: false,
                },
                {
                    label: 'Manage Customer',
                    key : '0-1-1',
                    icon : 'mdi-folder-account-outline',
                    disabled: false,
                    buttonColor: 'purple',
                    active: false,
                    children : [
                        {
                            label: 'Create Customer',
                            key : '0-1-1-0',
                            icon : 'mdi-account-plus',
                            disabled: false,
                            buttonColor: 'purple',
                            link: '/customer/create',
                            active: false,
                        }
                    ]
                }
            ]
        },
        {
            label: 'Invoices',
            key : '0-2',
            icon : 'mdi-text-box',
            disabled: false,
            buttonColor: 'purple',
            link: '/invoices/home',
            badgeContent: () => {return useAppStore().invoiceCount},
            active: false,
        },
        {
            label: 'Admin',
            key : '0-3',
            icon : 'mdi-shield-account',
            disabled: false,
            buttonColor: 'purple',
            link: '/admin',
            active: false,
        },
        {
            label: 'Help',
            key : '0-4',
            icon: 'mdi-help',
            buttonColor: 'purple',
            disabled: false,
            link: 'https://blink.ucsd.edu/finance/billing/get-started/training/ciperb/index.html',
            active: false,
        }
    ] as Array<TileRecord>
}

