export type MenuItem = {
    title: string;
    href: string;
    slug: string;
    parent_slug: string | null;
    area: 'orders' | 'products' | 'dashboard' | 'settings' | 'addons';
    mode: 'spa' | 'bridge';
  };
  
  export const STATIC_MAIN = [
    { path: '/dashboard', label: 'Dashboard', area: 'dashboard' },
    { path: '/orders',    label: 'Orders',    area: 'orders'    },
    { path: '/products',  label: 'Products',  area: 'products'  },
    { path: '/coupons',   label: 'Coupons',   area: 'settings'  },
    { path: '/customers', label: 'Customers', area: 'settings'  },
    { path: '/settings',  label: 'Settings',  area: 'settings'  },
  ] as const;
  
  export function groupMenus(dynamicItems: MenuItem[]) {
    const buckets = { dashboard: [], orders: [], products: [], settings: [], addons: [] as MenuItem[] };
    for (const it of dynamicItems) {
      if (it.area in buckets) (buckets as any)[it.area].push(it);
      else buckets.addons.push(it);
    }
    return buckets;
  }