@page "/administrators"
@using Blazorise.DataGrid
@using Blazor.ViewClasses
<PageTitle>@Localizer["PageTitle"]</PageTitle> 
<h3>@Localizer["Title"]</h3>

<div>
    <NavLink class="btn btn-primary" href="addAdministrator" Match="NavLinkMatch.All">
        <i class="fa fa-plus"></i> @Localizer["Add"]
    </NavLink>
</div>
<DataGrid TItem="Administrator"
          Data="@administrators"
          ReadData="@OnReadData"
          TotalItems="@totalItem"
          PageSize="10"
          ShowPager
          Responsive>
    <DataGridColumn TItem="Administrator" Field="@nameof(Administrator.Id)" Caption="#" />
    <DataGridColumn TItem="Administrator" Field="@nameof(Administrator.Username)" Caption="@Localizer["Username"]" />
    <DataGridColumn TItem="Administrator" Field="@nameof(Administrator.Id)" Caption="Action">
        <DisplayTemplate>
            <a href="editAdministrator/@(context.Id)" class="btn btn-primary"><i class="fa fa-edit"></i> @Localizer["Edit"]</a>
            <button type="button" class="btn btn-danger" @onclick="() => OnDelete(context.Id)"><i class="fa fa-trash"></i> @Localizer["Delete"]</button>
        </DisplayTemplate>
    </DataGridColumn>
</DataGrid>

