@model MemberCenter.Web.Models.Profile.AddressesPageViewModel
@{
    ViewData["Title"] = Model.Form.Id.HasValue ? L["Edit Address"] : L["Add Address"];
}

@if (TempData["Error"] is string error)
{
  <div class="alert alert-danger">@error</div>
}

<form asp-area="" asp-controller="Profile" asp-action="SaveAddress" method="post" class="admin-form-panel">
  @Html.AntiForgeryToken()
  <input asp-for="Form.Id" type="hidden" />
  <input name="Form.IsDefault" type="hidden" value="@Model.Form.IsDefault.ToString().ToLowerInvariant()" />
  <input asp-for="Form.AddressMetaJson" type="hidden" />
  <div asp-validation-summary="All"></div>

  <div class="address-form-grid">
    <div class="form-field">
      <label asp-for="Form.Label">@L["Label"]</label>
      <input asp-for="Form.Label" />
    </div>
    <div class="form-field">
      <label asp-for="Form.RecipientName">@L["Recipient name"]</label>
      <input asp-for="Form.RecipientName" />
    </div>
    <div class="form-field">
      <label asp-for="Form.RecipientPhone">@L["Recipient phone"]</label>
      <input asp-for="Form.RecipientPhone" />
    </div>
    <div class="form-field">
      <label asp-for="Form.CountryCode">@L["Country code"]</label>
      <input asp-for="Form.CountryCode" />
    </div>
    <div class="form-field">
      <label asp-for="Form.PostalCode">@L["Postal code"]</label>
      <input asp-for="Form.PostalCode" />
    </div>
    <div class="form-field">
      <label asp-for="Form.StateRegion">@L["State / region"]</label>
      <input asp-for="Form.StateRegion" />
    </div>
    <div class="form-field">
      <label asp-for="Form.City">@L["City"]</label>
      <input asp-for="Form.City" />
    </div>
    <div class="form-field">
      <label asp-for="Form.District">@L["District"]</label>
      <input asp-for="Form.District" />
    </div>
    <div class="form-field">
      <label asp-for="Form.AddressLine1">@L["Address line 1"]</label>
      <input asp-for="Form.AddressLine1" />
    </div>
    <div class="form-field">
      <label asp-for="Form.AddressLine2">@L["Address line 2"]</label>
      <input asp-for="Form.AddressLine2" />
    </div>
    <div class="form-field profile-form-wide">
      <label asp-for="Form.CompanyName">@L["Company name"]</label>
      <input asp-for="Form.CompanyName" />
    </div>
  </div>

  <div class="profile-form-actions">
    <a class="profile-pill-link" asp-area="" asp-controller="Profile" asp-action="Index">@L["Cancel"]</a>
    <button type="submit" class="profile-pill-button">@L["Save"]</button>
  </div>
</form>
