export const menuItems = (data, submitAction) => {
    return {
        firstMenuItem: {
            iconName: 'envelope',
            menuId: 'main-1', //random generated unique id
            additionalClass: (index) => {
                const obj = data[index]
                const commonClasses = 'btn-action btn-default'
                return obj.IsRead ? `invisible ${commonClasses}` :commonClasses
            },
            menuTarget: '#',
            handler: index => {
                const obj = data[index]
                 /**
                 * notificationId, isRead, isDeleted, indexOfRecord, deletionRequest
                 */
                // submitAction(obj.NotificationId, !obj.IsRead, obj.IsDelete, index, false) 
                submitAction(obj.NotificationId, true, obj.IsDelete, index, false) 
                
            }
        },
        secondMenuItem: {
            iconName: 'trash-alt',
            menuId: 'main-2', //random generated unique id
            additionalClass: (index) => { 
                const commonClasses = 'btn-action btn-default'
                return `${commonClasses}`
            },
            menuTarget: '#' ,
            handler: index => {
                const obj = data[index]
                /**
                 * notificationId, isRead, isDeleted, indexOfRecord, deletionRequest
                 */
                submitAction(obj.NotificationId, obj.IsRead, true, index, true)
                // submitAction(obj.notificationId, false, !obj.isDeleted, index, true) //debugging
            }
            
        },
        dropDownItems:[]
    }
}

