|
|
|
@ -1,5 +1,4 @@
|
|
|
|
|
using blazor_lab.Services;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Minecraft.Crafting.Api.Models;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -11,20 +10,12 @@ namespace blazor_lab.Components
|
|
|
|
|
[Parameter]
|
|
|
|
|
public List<InventoryModel> Inventory { get; set; }
|
|
|
|
|
|
|
|
|
|
public List<Models.Item> Items { get; set; } = new List<Models.Item>();
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
public IConfiguration Config { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Inject]
|
|
|
|
|
private DataApiService dataApiService { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
Items = await dataApiService.All();
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used by GetItemImageBase64 in this component, rather than calling our DataService every time.
|
|
|
|
|
/// A very basic cache, not kept up to date in any way, but event listeners could be set up in the future
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Parameter]
|
|
|
|
|
public List<Models.Item> Items { get; set; }
|
|
|
|
|
|
|
|
|
|
public string GetItemImageBase64(string displayName)
|
|
|
|
|
{
|
|
|
|
|