// Export all page data
export { dashboardPageData } from './dashboard';
export { filesPageData } from './files';
export { workflowsPageData } from './workflows';
export { automationsPageData } from './automations';
export { connectionsPageData } from './connections';
export { teamMembersPageData } from './admin/team-members';
export { promptsPageData } from './prompts';
export { speechPageData } from './speech';
export { settingsPageData } from './settings';
export { pekPageData } from './pek';
export { pekTablesPageData } from './pek-tables';
export { chatbotPageData } from './chatbot';
export { mandatesPageData } from './admin/mandates';
export { rbacRulesPageData } from './admin/rbac-rules';
export { rbacRolePageData } from './admin/rbac-role';
// Trustee pages (no container - SidebarProvider creates virtual parent group)
export { 
    trusteeOrganisationsPageData,
    trusteeRolesPageData,
    trusteeAccessPageData,
    trusteeContractsPageData,
    trusteeDocumentsPageData,
    trusteePositionsPageData,
    trusteePages
} from './trustee';

// Import all page data
import { dashboardPageData } from './dashboard';
import { filesPageData } from './files';
import { workflowsPageData } from './workflows';
import { automationsPageData } from './automations';
import { connectionsPageData } from './connections';
import { teamMembersPageData } from './admin/team-members';
import { promptsPageData } from './prompts';
import { speechPageData } from './speech';
import { settingsPageData } from './settings';
import { pekPageData } from './pek';
import { pekTablesPageData } from './pek-tables';
import { chatbotPageData } from './chatbot';
import { mandatesPageData } from './admin/mandates';
import { rbacRulesPageData } from './admin/rbac-rules';
import { rbacRolePageData } from './admin/rbac-role';
import { trusteePages } from './trustee';

// Array of all page data
export const allPageData = [
    // Workflows group
    dashboardPageData,  // Chat Playground
    workflowsPageData,  // Workflows list
    automationsPageData, // Automations
    // Basedata group
    filesPageData,
    promptsPageData,
    // Other pages
    connectionsPageData,
    speechPageData,
    settingsPageData,
    pekPageData,
    pekTablesPageData,
    chatbotPageData,
    // Trustee pages
    ...trusteePages,
    // Admin pages
    teamMembersPageData,
    mandatesPageData,
    rbacRulesPageData,
    rbacRolePageData,
];

// Helper function to get page data by path
export const getPageDataByPath = (path: string) => {
    return allPageData.find(page => page.path === path);
};

// Helper function to get all pages with subpages organized
export const getPageHierarchy = () => {
    const pages = allPageData.filter(page => !page.parentPath);
    const subpages = allPageData.filter(page => page.parentPath);
    
    return {
        mainPages: pages,
        subpages: subpages,
        allPages: allPageData
    };
};
