1
0
mirror of synced 2024-12-03 02:27:20 +01:00
TaikoLocalServer/TaikoWebUI/Components/Song/SongLeaderboardCard.razor

67 lines
3.1 KiB
Plaintext
Raw Normal View History

2024-06-03 01:55:44 +02:00
@inject HttpClient Client;
2024-06-03 03:00:54 +02:00
@inject Blazored.LocalStorage.ILocalStorageService LocalStorage;
2024-06-03 01:55:44 +02:00
@using TaikoWebUI.Utilities;
2024-06-03 01:29:33 +02:00
2024-06-03 01:55:44 +02:00
<MudCard Outlined="true" Elevation="0">
<MudCardHeader>
2024-06-03 03:00:54 +02:00
<MudGrid Spacing="2" Class="align-center">
<MudItem xs="12" md="6">
2024-06-03 01:55:44 +02:00
<MudText Typo="Typo.h6">@Localizer["Leaderboard"]</MudText>
</MudItem>
2024-06-03 03:00:54 +02:00
<MudItem xs="12" md="6">
<MudSelect Dense="true" T="string" Label="@Localizer["Difficulty"]" Variant="Variant.Outlined" Margin="Margin.Dense" ValueChanged="(value) => OnDifficultyChange(value)" Value="SelectedDifficulty">
@foreach (var difficulty in Enum.GetValues(typeof(Difficulty)))
{
var difficultyValue = (Difficulty)difficulty;
<MudSelectItem Value="@difficultyValue.ToString()">
@ScoreUtils.GetDifficultyTitle(difficultyValue)
</MudSelectItem>
}
</MudSelect>
</MudItem>
2024-06-03 01:55:44 +02:00
</MudGrid>
</MudCardHeader>
<MudCardContent Class="pa-0">
2024-06-03 03:00:54 +02:00
@if (response == null)
{
<MudCircularProgress />
}
else
{
<MudTable Items="@response.Leaderboard" Class="leaderboard-table" Elevation="0" Outlined="false" Dense="true" Striped="true">
<HeaderContent>
<MudTh>@Localizer["Rank"]</MudTh>
<MudTh>@Localizer["Player"]</MudTh>
<MudTh>@Localizer["Score"]</MudTh>
<MudTh>@Localizer["Rank"]</MudTh>
<MudTh>@Localizer["Crown"]</MudTh>
</HeaderContent>
<RowTemplate>
<MudTd>@context.Rank</MudTd>
<MudTd>
<MudStack Row="true" AlignItems="AlignItems.Baseline">
<MudText Typo="Typo.body1">@context.UserName</MudText>
<MudText Typo="Typo.caption">(@Localizer["ID"]: @context.Baid)</MudText>
</MudStack>
</MudTd>
<MudTd>@context.BestScore</MudTd>
<MudTd>
@if (context.BestScoreRank is not ScoreRank.None)
{
<img src="@($"/images/rank_{context.BestScoreRank}.png")" alt="@(ScoreUtils.GetRankText(context.BestScoreRank))" title="@(ScoreUtils.GetRankText(context.BestScoreRank))" style="@IconStyle"/>
}
else
{
<MudText Typo="Typo.body1">—</MudText>
}
</MudTd>
<MudTd>
<img src="@($"/images/crown_{context.BestCrown}.png")" alt="@(ScoreUtils.GetCrownText(context.BestCrown))" title="@(ScoreUtils.GetCrownText(context.BestCrown))" style="@IconStyle"/>
</MudTd>
</RowTemplate>
</MudTable>
}
</MudCardContent>
2024-06-03 01:55:44 +02:00
</MudCard>