@model IEnumerable @using WebfrontCore.ViewModels

@ViewBag.Localization["WEBFRONT_TOP_PLAYERS_TITLE"]

@ViewBag.TotalRankedClients.ToString("#,##0") @ViewBag.Localization["WEBFRONT_TOP_PLAYERS_SUBTITLE"]
@await Component.InvokeAsync("TopPlayers", new { count = 25, offset = 0, serverEndpoint = ViewBag.SelectedServerId, performanceBucket = ViewBag.SelectedPerformanceBucket })
@{ var menuItems = new SideContextMenuItems { MenuTitle = ViewBag.Localization["WEBFRONT_CONTEXT_MENU_GLOBAL_GAME"], Items = Model.GroupBy(server => server.PerformanceBucket).Where(grp => grp.Key is not null).Select(server => new SideContextMenuItem { IsLink = true, Reference = Url.Action("TopPlayers", "Stats", new { performanceBucket = server.First().PerformanceBucket }), Title = server.First().PerformanceBucket.StripColors(), IsActive = ViewBag.SelectedPerformanceBucket == server.First().PerformanceBucket, Meta = server.First().Game.ToString(), IsCollapse = false }).Prepend(new SideContextMenuItem { IsLink = true, Reference = Url.Action("TopPlayers", "Stats"), Title = ViewBag.Localization["WEBFRONT_STATS_INDEX_ALL_SERVERS"], IsActive = ViewBag.SelectedServerId is null }).Concat(Model.Select(server => new SideContextMenuItem { IsLink = true, Reference = Url.Action("TopPlayers", "Stats", new { serverId = server.Endpoint }), Title = server.Name.StripColors(), IsActive = ViewBag.SelectedServerId == server.Endpoint, Meta = server.Game.ToString(), IsCollapse = true })).ToList() }; }
@section scripts { }