@model IEnumerable<SharedLibraryCore.Dtos.PlayerInfo>
@{
    Layout = null;
}

@foreach (var client in Model)
{
    <div class="bg-very-dark-dm bg-light-ex-lm p-15 rounded mb-10">
        <div class="d-flex flex-row">
            <a asp-controller="Client" asp-action="Profile" asp-route-id="@client.ClientId" class="h4 mr-auto">
                <color-code value="@client.Name"></color-code>
            </a>
            @if (client.GeoLocationInfo is not null)
            {
                @if (!string.IsNullOrEmpty(client.GeoLocationInfo.CountryCode))
                {
                    <div data-toggle="tooltip" data-title="@client.GeoLocationInfo.Country">
                        <div class="rounded" style="width: 40px; height: 25.66px; background-repeat: no-repeat; background-position: center center; background-image: url('https://flagcdn.com/w40/@(client.GeoLocationInfo.CountryCode.ToLower()).png')"></div>
                    </div>
                }
            }
        </div>
        <div class="d-flex flex-row">
            <has-permission entity="ClientIPAddress" required-permission="Read">
                <div class="align-self-center mr-auto">@client.IPAddress</div>
            </has-permission>
            <div class="align-self-center text-muted font-size-12">@client.LastConnection.HumanizeForCurrentCulture()</div>
        </div>
    </div>
}
