<% layout('layouts/main') %>
<% const clientBase = typeof clientBaseUrl !== 'undefined' ? clientBaseUrl : '/client'; %>
<div class="app-shell">
  <%- partial('partials/client-nav') %>
  <section class="content">
    <div class="page-head"><h1>Mon profil</h1></div>
    <form method="post" class="panel form-grid">
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <div class="form-grid two"><label>Prénom<input name="first_name" value="<%= profile.first_name %>"></label><label>Nom<input name="last_name" value="<%= profile.last_name %>"></label></div>
      <div class="form-grid two"><label>Téléphone<input name="phone" value="<%= profile.phone || '' %>"></label><label>Type de client<select name="client_type"><option value="particulier" <%= profile.client_type==='particulier'?'selected':'' %>>Particulier</option><option value="entreprise" <%= profile.client_type==='entreprise'?'selected':'' %>>Entreprise</option></select></label></div>
      <label>Entreprise<input name="company_name" value="<%= profile.company_name || '' %>"></label>
      <label>Adresse<input name="address" value="<%= profile.address || '' %>"></label>
      <div class="form-grid two"><label>NPA<input name="postal_code" value="<%= profile.postal_code || '' %>"></label><label>Ville<input name="city" value="<%= profile.city || '' %>"></label></div>
      <button>Enregistrer</button>
    </form>
    <form method="post" action="<%= clientBase %>/suppression-compte" class="panel">
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <button class="secondary">Demander la suppression du compte</button>
    </form>
  </section>
</div>
