@model SharedLibraryCore.Dtos.ServerInfo @{ Layout = null; var half = Model.ClientCount == 0 || Model.Players.Count == 0 ? 0 : (int)Math.Ceiling(Model.ClientCount / 2.0); var groupedClients = Model.Players.Select((client, i) => new { index = i, client }) .OrderBy(client => client.client.Name) .GroupBy(client => client.index >= half).Select((group, index) => new { group, index }).ToList(); string GetIconForState(string messageState) { return messageState switch { "CONNECTED" => "oi-account-login text-success mr-5", "DISCONNECTED" => "oi-account-logout text-danger mr-5", _ => "" }; } }