@using BlazorAppClean.Models

<CascadingValue Value="@this">
    <div class="css-grid">
        <div><h1>List</h1></div>

        <DataGrid TItem="Item"
                  Data="@Items"
                TotalItems="8"
                PageSize="8"
                Filterable
                ShowPager
                Responsive>
            <DataGridColumn TItem="Item" Field="@nameof(Item.Id)" Caption="Image" Filterable="false" Sortable="false">
                <DisplayTemplate>
                        @if (!string.IsNullOrWhiteSpace(context.ImageBase64))
                        {
                            <img src="data:image/png;base64, @(context.ImageBase64)" class="img-thumbnail" title="@context.DisplayName" alt="@context.DisplayName" style="min-width: 50px; max-width: 150px"/>
                        }
                </DisplayTemplate>
            </DataGridColumn>
            <DataGridColumn TItem="Item" Field="@nameof(Item.DisplayName)" Caption="Nom"/>
            <DataGridColumn TItem="Item" Field="@nameof(Item.StackSize)" Caption="Stack" Filterable="false"  Sortable="false"/>
        </DataGrid>
    </div>
        
    <div><h1>Inventory</h1></div>
    <div class="css-recipe">
        @for (int i = 0; i < 27; i++)
            {
                <GetItemInInventory Index="@i" />

            }
    </div>

</CascadingValue>