function returnMembers() {
    return {
        canLoadMore: true,
        members: [
            {
                id: 'john.doe@wickes.co.uk',
                name: 'John Doe',
                email: 'john.doe@wickes.co.uk',
                date: '24/02/2022',
                'order-history-url': 'page_tradePro_order-history.html',
                status: 'PENDING',
                'card-label': 'Pending',
            },
            {
                id: 'john.doe2@wickes.co.uk',
                name: 'John Doe2',
                email: 'john.doe2@wickes.co.uk',
                date: '24/02/2022',
                'order-history-url': 'page_tradePro_order-history.html',
                'card-label': 'Other label',
            },
            {
                id: 'john.doe3@wickes.co.uk',
                name: 'John Doe3',
                email: 'john.doe3@wickes.co.uk',
                date: '24/02/2022',
                'order-history-url': 'page_tradePro_order-history.html',
            },
        ],
    };
}

function initAccountHubFunctionality() {
    Wick.AccountHub.initAccountHub();
    Wick.AccountHub.initAccountHubRemove();

    $(window).on(Wick.AccountHub.LOAD_MORE_EVENT, function (e) {
        setTimeout(() => {
            e.detail.resolve(returnMembers());
        }, 1000);
    });
}

$(document).ready(function () {
    if (!$('.account-hub').length) {
        return;
    }
    initAccountHubFunctionality();
});
