LANCommander/LANCommander.Launcher/UI/Components/Footer.razor
2024-08-09 01:24:24 -05:00

41 lines
960 B
Text

@using LANCommander.Launcher.Models
@using System.Diagnostics
@inject DownloadService DownloadService
@inject SDK.Client Client
@inject GameService GameService
<footer>
<LibraryItemFilter />
@if (DownloadService.Queue.Any(qi => qi.State))
{
<div class="downloader" @onclick="() => ShowDownloadQueue()">
<CurrentDownloadItem ShowIcon="true" />
</div>
}
else
{
<Button Type="@ButtonType.Text" Icon="@IconType.Outline.Download" OnClick="() => ShowDownloadQueue()">Downloads</Button>
}
</footer>
<DownloadQueue @ref="DownloadQueue" />
@code {
bool DownloadQueueVisible = false;
DownloadQueue DownloadQueue;
protected override async Task OnInitializedAsync()
{
DownloadService.OnQueueChanged += async () =>
{
await InvokeAsync(StateHasChanged);
};
}
async Task ShowDownloadQueue()
{
await DownloadQueue.Show();
}
}