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

<h1>Newsletter Lists</h1>
<p><a href="/admin/newsletter-lists/create">Create</a></p>
<table>
  <thead>
    <tr><th>List ID</th><th>Name</th><th>Tenant</th><th>Status</th><th></th></tr>
  </thead>
  <tbody>
  @foreach (var list in Model)
  {
    <tr>
      <td><code>@list.Id</code></td>
      <td>@list.Name</td>
      <td>@(string.IsNullOrWhiteSpace(list.TenantName) ? list.TenantId.ToString() : list.TenantName)</td>
      <td>@list.Status</td>
      <td>
        <a href="/admin/newsletter-lists/edit/@list.Id">Edit</a>
        <form method="post" action="/admin/newsletter-lists/delete/@list.Id" style="display:inline">
          <button type="submit">Delete</button>
        </form>
      </td>
    </tr>
  }
  </tbody>
</table>
