<%- layout('layout/dashboard-template')%>
<!-- BREADCRUMBS -->
<div class="">
  <nav style="--bs-breadcrumb-divider: '>';" aria-label="breadcrumb">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="/dashboard">Dashboard</a></li>
    <li class="breadcrumb-item active" aria-current="page">Customers</li>
  </ol>
</nav>
</div>

<div class="white rounded p-3">
  <h1 class="mb-5">Customers</h1>

  <table class="table mb-5">
    <thead class="table-light">
      <tr>
        <th scope="col"></th>
        <th scope="col">Name</th>
        <th scope="col">Phone Number</th>
        <th scope="col">Email Address</th>
        <th scope="col">Address</th>
        <th scope="col"></th>
        </tr>
      </thead>

    <tbody class="table-primary">
        <% for (let customer of customers) { %>
      <tr>
        <th scope="row"><a class="btn btn-primary btn-sm"
              href="/dashboard/customers/<%= customer._id %>/edit">
                Edit</a></th>
        <td><%= customer.name %></td>
        <td><%= customer.tel %></td>
        <td><%= customer.email %></td>
        <td><%= customer.address %></td>
        <td>
          <form class="" action="/dashboard/customers/<%= customer._id %>?_method=DELETE" method="post">
            <button class="btn btn-danger btn-sm">Delete</button>
          </form>
        </td>
      </tr>
      <% } %>
    </tbody>
</table>

    <a class="btn btn-primary btn-sm"
    href="/dashboard/customers/new">Add new</a>
  </div>
