@model IEnumerable<WebVentaCoche.Models.User>

@{
    ViewData["Title"] = "Listado de Usuarios";
}

<h2 class="mb-4">Usuarios Registrados</h2>

<a asp-action="Create" class="btn btn-success mb-3">
    <i class="fa fa-plus me-1"></i> Crear Usuario
</a>

<table class="table table-striped align-middle">
    <thead class="table-dark">
        <tr>
            <th>Email</th>
            <th>Nombre</th>
            <th>Apellidos</th>
            <th>Tipo</th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var u in Model)
        {
            <tr>
                <td>@u.Email</td>
                <td>@u.Name</td>
                <td>@u.Surname</td>
                <td>@u.UserType</td>
                <td class="text-end">
                    <a asp-action="Edit" asp-route-id="@u.Id"
                       class="btn btn-sm btn-info me-2">
                        <i class="fa fa-eye"></i>
                    </a>
                </td>
            </tr>
        }
    </tbody>
</table>
