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

<h1>Tenants</h1>
<p><a href="/admin/tenants/create">Create</a></p>
<table>
  <thead>
    <tr><th>Name</th><th>Tenant Id</th><th>Webhook Client Id</th><th>Domains</th><th>Status</th><th></th></tr>
  </thead>
  <tbody>
  @foreach (var tenant in Model)
  {
    <tr>
      <td>@tenant.Name</td>
      <td><code>@tenant.Id</code></td>
      <td><code>@(tenant.SendEngineWebhookClientId?.ToString() ?? "-")</code></td>
      <td>@string.Join(",", tenant.Domains)</td>
      <td>@tenant.Status</td>
      <td>
        <a href="/admin/tenants/edit/@tenant.Id">Edit</a>
        <form method="post" action="/admin/tenants/delete/@tenant.Id" style="display:inline">
          <button type="submit">Delete</button>
        </form>
      </td>
    </tr>
  }
  </tbody>
</table>
