@using BlazorT.Composants
@using BlazorT.Models;
@using BlazorStrap.V5

 
<BSDataTableRow ondragover="event.preventDefault();"
                draggable="true"
                @ondragstart="@OnDragStart"
                @ondrop="@OnDrop"
                @ondragenter="@OnDragEnter"
                @ondragleave="@OnDragLeave">
    <BSTD>
        @Item.Id
    </BSTD>
    <BSTD>
        <DisplayTemplate>
            @if (!string.IsNullOrWhiteSpace(Item.ImageBase64))
            {
                <img src="data:image/png;base64, @(Item.ImageBase64)" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName" style="min-width: 50px; max-width: 150px" />
            }
            else
            {
                <img src="images/default.png" class="img-thumbnail" title="@Item.DisplayName" alt="@Item.DisplayName" style="max-width: 150px" />
            }
        </DisplayTemplate>
    </BSTD>
    <BSTD>
        @Item.Name
    </BSTD>
    <BSTD>
        <DisplayTemplate>
            <a href="Edit/@(Item.Id)" class="btn btn-primary"><i class="fa fa-edit"></i> Editer</a>
            <button type="button" class="btn btn-primary" @onclick="() => OnDeleteAsync(Item.Id)"><i class="fa fa-trash"></i> Supprimer</button>
        </DisplayTemplate>
    </BSTD>

</BSDataTableRow>
