import { mainNavItem } from '@admin/types';
import { Users, Building2 } from 'lucide-react';

export const crmMenuItems = (module: any) => {

    // Return an empty array if module or module_menu is missing
    if (!module || !module.module_menu) return [];

    // Check if the first menu is active (adjust index if needed)
    const isMenuActive = module.module_menu[0]?.is_active;

    return isMenuActive
        ? [
            {
                title: 'Customer',
                icon: Users,
                url: route('crm.customer.index'),
            },
            {
                title: 'Company',
                icon: Building2,
                url: route('crm.company.index'), // Change this when Organization module is created
            },
        ]
        : [];
};
