<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Solicitudes</title>
  <link rel="stylesheet" href="/css/solicitudesStyle.css">

</head>

<body>
  <%- include('../navbar', LoginData) %>
  <div class="row">
    <div class="img_sh_title">
      <hr class="hr_left">
      <label>COMISIONES PARA TI</label>
      <hr class="hr_right">
    </div>
    <div class="inner__comms">
      <% if (ReqCommList.Comms_To) { %>

      <% } else { %>
      <h3>NO TIENES COMISIÓNES PENDIENTES</h3>
      <% } %>
    </div>
  </div>
  <div class="row">
    <div class="img_sh_title">
      <hr class="hr_left">
      <label>TUS PEDIDOS DE COMISION</label>
      <hr class="hr_right">
    </div>
    <div class="outer__comms">
      <% if (ReqCommList.Comms_From) { %>

      <% } else { %>
      <h3>NO HAS REALIZADO PEDIDOS DE COMISIÓN</h3>
      <% } %>
    </div>
  </div>
  <div class="row">
    <div class="img_sh_title">
      <hr class="hr_left">
      <label>REQUESTS PARA TI</label>
      <hr class="hr_right">
    </div>
    <div class="inner_reqs">
      <% if (ReqCommList.Req_To) { %>
        <% if (ReqCommList.Req_To.req_id) { %>
          <div class="req_card" style="border: 3px solid transparent !important;">
            <div class="header">
                <div class="author_img" style="background-image: url(/images<%=ReqCommList.Req_To.profile_pic_dir%>);">
                </div>
                <div class="author_info">
                    <p class="author_name">
                        <%= ReqCommList.Req_To.nickname %> 
                    </p>
                    <p class="req_date">
                        <%= ReqCommList.Req_To.request_date %> 
                    </p>
                </div>
            </div>
            <div class="description">
                <p>
                    <%= ReqCommList.Req_To.requester_comment %> 
                </p>
            </div>
            <div class="buttons">
                <button class="accept">ACEPTAR</button>
                <button class="deny">RECHAZAR</button>
            </div>
        </div>
        <% } else { %> 
          <% for( let i = 0; i < ReqCommList.Req_To.length; i++ ) { %>
            <div class="req_card" style="border: 3px solid transparent !important;">
              <div class="header">
                  <div class="author_img" style="background-image: url(/images<%=ReqCommList.Req_To[i].profile_pic_dir%>);">
                  </div>
                  <div class="author_info">
                      <p class="author_name">
                          <%= ReqCommList.Req_To[i].nickname %> 
                      </p>
                      <p class="req_date">
                          <%= ReqCommList.Req_To[i].request_date %> 
                      </p>
                  </div>
              </div>
              <div class="description">
                  <p>
                      <%= ReqCommList.Req_To[i].requester_comment %> 
                  </p>
              </div>
              <div class="buttons">
                  <button class="accept">ACEPTAR</button>
                  <button class="deny">RECHAZAR</button>
              </div>
          </div>
          <% } %>
        <% } %>
      <% } else { %>
      <h3>NO TIENES REQUESTS PENDIENTES</h3>
      <% } %>
    </div>
  </div>
  <div class="row">
    <div class="img_sh_title">
      <hr class="hr_left">
      <label>TUS PEDIDOS DE REQUEST</label>
      <hr class="hr_right">
    </div>
    <div class="outer_reqs">
      <% if (ReqCommList.Req_From) { %>

      <% } else { %>
      <h3>NO HAS REALIZADO NINGUN REQUEST</h3>
      <% } %>
    </div>
  </div>

</body>

</html>