@using WebVentaCoche.Enums
@model WebVentaCoche.ViewModels.UserViewModel

@{
    ViewData["Title"] = "Editar Usuario";
}

<div class="container mt-4">
    <h2 class="mb-4">Editar Usuario</h2>

    <form asp-action="Edit" method="post">
        @Html.AntiForgeryToken()
        <input type="hidden" asp-for="Id" />

        <div class="mb-3">
            <label asp-for="Name" class="form-label"></label>
            <input asp-for="Name" class="form-control" />
            <span asp-validation-for="Name" class="text-danger"></span>
        </div>

        <div class="mb-3">
            <label asp-for="Surname" class="form-label"></label>
            <input asp-for="Surname" class="form-control" />
            <span asp-validation-for="Surname" class="text-danger"></span>
        </div>

        <div class="mb-3">
            <label asp-for="Email" class="form-label"></label>
            <input asp-for="Email" class="form-control" />
            <span asp-validation-for="Email" class="text-danger"></span>
        </div>

        <div class="mb-3">
            <label asp-for="PhoneNumber" class="form-label"></label>
            <input asp-for="PhoneNumber" class="form-control" />
            <span asp-validation-for="PhoneNumber" class="text-danger"></span>
        </div>

        <div class="mb-3">
            <label asp-for="UserType" class="form-label"></label>
            <select asp-for="UserType"
                    asp-items="Html.GetEnumSelectList<UserType>()"
                    class="form-select">
            </select>
            <span asp-validation-for="UserType" class="text-danger"></span>
        </div>

        <button type="submit" class="btn btn-primary">Guardar cambios</button>
        <a asp-action="Index" class="btn btn-secondary ms-2">Cancelar</a>
    </form>
</div>

@section Scripts {
    @{
        await Html.RenderPartialAsync("_ValidationScriptsPartial");
    }
}
