<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="/navbar.css">
    <link rel="stylesheet" href="/profile/user.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.3/css/all.css" integrity="sha384-SZXxX4whJ79/gErwcOYf+zWLeJdY/qpuqC4cAa9rOGUstPomtqpuNWT9wdPEn2fk" crossorigin="anonymous">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
    <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
    <title><%- client.user.username %> | <%- user.username %></title>
    <link rel="icon" href="<%- user.displayAvatarURL({format:"png", size:2048}) %>">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8">
  </head>
  
  <body class="bg-gray-800 text-white">
    
    <nav class="navbar shadow-lg navbar-expand-lg navbar-dark bg-gray-800">
      <div class="container">
        <a class="navbar-brand" href="#">
          <img src="https://cdn.discordapp.com/attachments/700935494711771147/841545130636476436/image_18.png" width="40" height="34">
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarNav">
          <ul class="navbar-nav ms-auto">
            <li class="nav-item">
              <a class="nav-link active" aria-current="page" href="/">Home</a>
            </li>
            <% if(!req.user) { %>
            <li class="nav-item">
              <a class="nav-link" href="/login">Login</a>
            </li>
            <% } if(req.user) { %>
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" id="dropdown-account" data-bs-toggle="dropdown" aria-expanded="false" href="#" ><%- req.user.username %>#<%- req.user.discriminator %></a>
              <ul data-labelledby="dropdown-account" class="dropdown-menu">
                <li><a href="/add" class="dropdown-item">Add Bot</a></li>
                <li><a href="/user/<%- req.user.id %>" class="dropdown-item">Profile</a></li>
                <li><a href="/logout" class="dropdown-item">Logout</a></li>
              </ul>
            </li>
            <% } %>
          </ul>
        </div>
      </div>
    </nav>
    
    
    <div class="container-fluid">
      
          <div class="userSection">
            <img src="<%- user.displayAvatarURL({format:"png", size:2048}) %>" class="img-fluid userAvatar mt-10 mx-auto rounded-full">
            <div class="mt-4 text-center">
              <% if(client.guilds.cache.get("819924361183756349").roles.cache.get("819927563400904764").members.map(x => x.user.id).includes(req.params.id)) { %>
              <i class="fas fa-users"><span class="text">Teams</span></i>
              <% } %>
              <% if(["580640622235484161"].includes(req.params.id)) { %>
              <i class="fas ml-1 fa-hands-helping"><span>Helpers</span></i>
              <% } %>
              <% if(client.guilds.cache.get("819924361183756349").roles.cache.get("832623307702009876").members.map(x => x.user.id).includes(req.params.id)) { %>
              <i class="fas fa-code"><span>Developer</span></i>
              <% } %>
              <% if(client.guilds.cache.get("819924361183756349").roles.cache.get("850274430193631272").members.map(x => x.user.id).includes(req.params.id)) { %>
              <i class="fas fa-map-marker"><span>Beta User</span></i>
              <% } %>
              <% if(client.guilds.cache.get("819924361183756349").roles.cache.get("835870662605668372").members.map(x => x.user.id).includes(req.params.id)) { %>
              <i class="fas fa-handshake"><span>Partner</span></i>
              <% } %>
            </div>
            <h1 class="text-5xl mt-2 text-center"><%- user.username %></h1>
            <% let ownBot = allData.map(x => x.data).filter(x => x.ownerId == req.params.id) %>
            
            <p class="semibold mt-4 text-3xl text-center font-semibold"><%- ownBot.length %> bots</p>
            
            <center><hr style="width:80%;"></center>
            
            <div class="row row-cols-1 row-cols-md-3 g-4">
              <% ownBot.map(x => { %>
              <div class="col">
                <div style="width:100%"class="card mt-5 bg-gray-900 rounded-lg shadow-2xl">
                  <img width="100" height="100" class="mt-2 ml-2 rounded-full" src="<%- client.users.cache.get(x.id).displayAvatarURL({format:"png", size:2048}) %>">
                  <div class="card-body">
                    
                    <div class="vote mt-6">
                      <a href="/vote/<%- x.id %>" class="bg-pink-700 p-1 rounded-lg font-semibold"><i class="fas fa-chevron-up"></i> <%- x.vote %></a>
                    </div>
                    
                    <div class="downCard mt-4">
                      <h1 class="text-2xl font-sans font-semibold"><%- client.users.cache.get(x.id).username %></h1>
                      <div class="mt-1 mb-3 text-1xl" style="overflow-y:scroll !important;height:100px;">
                        <p><%- x.sdecs %></p>
                      </div>
                      
                      <% if(x.category.map !== undefined) { %>
                      <p class="mb-2 mt-1"><%- x.category.map(y => `
                      <span class="bg-blue-400 p-1 text-xs rounded-lg font-medium">${y}</span>
                      `).join("") %></p>
                      <% }else{ %>
                      <p class="mb-2"><span class="mb-2 bg-blue-400 p-1 text-xs rounded-lg font-medium"><%- x.category %></span></p>
                      <% } %>
                      
                      <hr>
                    </div>
                    
                    <div class="mt-3 font-semibold row row-cols-2 row-cols-md-2">
                      <div class="col">
                        <a class="view-invite block p-2 hover:text-white hover:bg-gray-600 hover:-translate-y-2 ease-in-out transition duration-700 transform rounded-lg text-center bg-blue-600" href="/bot/<%- x.id %>">View</a>
                      </div>
                      <div class="col">
                        <a class="view-invite block p-2 hover:text-white hover:bg-gray-600 hover:-translate-y-2 ease-in-out transition duration-700 transform rounded-lg text-center bg-blue-600" href="<%- x.invite %>">Invite</a>
                      </div>
                    </div>
                    <style>
                    
                    </style>
                    
                  </div>
                </div>
              </div>
              <% }) %>
            </div>
          </div>
        </div>
        <br>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
  </body>
</html>