@page "/Games/{id:guid}/Browse"
@inject GameService GameService

<Card Title="Archive Browser" SubTitle="@Game.Title">
    <Table>
        <ArchiveBrowser ArchiveId="@Archive.Id" />
    </Table>
</Card>

@code {
    [Parameter] public Guid Id { get; set; }

    private Game Game { get; set; }
    private Archive Archive { get; set; }

    protected override async Task OnInitializedAsync()
    {
        Game = await GameService.Get(Id);

        if (Game.Archives != null && Game.Archives.Count > 0)
            Archive = Game.Archives.OrderByDescending(a => a.CreatedOn).First();
    }
}
