<%- include("../partials/head") %>
<%- include("../partials/header") %>
<main class="container section narrow">
  <div class="panel">
    <h1>پروفایل</h1>
    <form class="stack" data-api-form data-endpoint="/api/users/update-profile" enctype="multipart/form-data">
      <div class="grid-two">
        <label>نام<input name="firstName" value="<%= user.profile?.firstName || '' %>" /></label>
        <label>نام خانوادگی<input name="lastName" value="<%= user.profile?.lastName || '' %>" /></label>
      </div>
      <div class="grid-two">
        <label>کشور<input name="country" value="<%= user.profile?.country || '' %>" /></label>
        <label>شهر<input name="city" value="<%= user.profile?.city || '' %>" /></label>
      </div>
      <label>ایمیل<input name="email" type="email" value="<%= user.email || '' %>" /></label>
      <label>شماره موبایل<input name="phone" value="<%= user.phone || '' %>" /></label>
      <label>Minecraft Username<input name="minecraftUsername" value="<%= user.minecraftProfile?.username || user.profile?.minecraftUsername || '' %>" /></label>
      <label>Minecraft UUID<input name="minecraftUuid" value="<%= user.minecraftProfile?.uuid || user.profile?.minecraftUuid || '' %>" /></label>
      <label>توضیحات<textarea name="bio"><%= user.profile?.bio || '' %></textarea></label>
      <label>تصویر پروفایل<input type="file" name="avatar" accept=".png,.jpg,.jpeg,.webp,.pdf" /></label>
      <button class="button" type="submit">ذخیره تغییرات</button>
    </form>
  </div>
</main>
<%- include("../partials/footer") %>
