using salesbook.Shared.Core.Dto.Users;

namespace salesbook.Shared.Core.Dto.PageState;

public class UserListState
{
    public List<UserDisplayItem>? GroupedUserList { get; set; }
    public List<UserDisplayItem>? FilteredGroupedUserList { get; set; }
    
    public List<ContactDTO>? AllUsers { get; set; }

    public bool IsLoaded { get; set; }
    public bool IsLoading { get; set; }
    
    public event Action? OnUsersLoaded;

    public void NotifyUsersLoaded()
    {
        IsLoaded = true;
        IsLoading = false;
        OnUsersLoaded?.Invoke();
    }
}
