@model IReadOnlyList<MemberCenter.Application.Models.Admin.EmailBlacklistDto>

<div class="admin-page-title">
  <h1>@L["Blacklist"]</h1>
@if (await AdminPermissionChecker.HasPermissionAsync(User, AdminPermissions.BlacklistCreate))
{
  <a class="account-action-button" href="/admin/blacklist/create">@L["Add Blacklist"]</a>
}
</div>

<div class="data-table-shell">
  <table class="data-table">
    <thead>
      <tr>
        <th class="data-table-index">#</th>
        <th>@L["Email"]</th>
        <th>@L["Reason"]</th>
        <th>@L["By"]</th>
        <th>@L["At"]</th>
        <th>@L["Action"]</th>
      </tr>
    </thead>
    <tbody>
    @if (!Model.Any())
    {
      <tr>
        <td colspan="6" class="data-table-empty">@L["No blacklist records."]</td>
      </tr>
    }
    else
    {
      var rowNumber = 1;
      foreach (var item in Model)
      {
        <tr>
          <td class="data-table-index">@rowNumber.ToString("000")</td>
          <td>@item.Email</td>
          <td>@item.Reason</td>
          <td>@item.BlacklistedBy</td>
          <td>@item.BlacklistedAt.ToString("yyyy/MM/dd HH:mm")</td>
          <td><span class="data-table-muted">-</span></td>
        </tr>
        rowNumber++;
      }
    }
    </tbody>
  </table>
</div>
