<!DOCTYPE html>
<html lang="pt-BR">
  <head>
    <%- include('./partials/head.ejs') %>
  </head>

  <body>
    <%- include('./partials/header.ejs') %>
    
    <% if(message != "") {%>
    <%= include('./partials/alerts.ejs') %>
    <% } %>

    <main>
      <section id="cards">
        <% if(coinSearch.length == 0) { %> <% coins.forEach((Coin , id) => { %>
        <%- include('./partials/card.ejs', {Coin: Coin}) %>
        <% }) %>
      </section>

      <% } else { %>

      <div id="result">
        <h2>Search result</h2>
      </div>

      <section id="cards">
        <% coinSearch.forEach((coin) => {%>
        <%- include('./partials/card.ejs', {Coin: coin}) %>
        <% }) %>
      </section>

      <% } %>
      <% if(coinPut != null) {%>
      <%- include('./partials/modalPut.ejs')%>
      <% } %>
      <% if(coinDel != null) {%>
      <%- include('./partials/modalDel.ejs') %>
      <% } %>

    </main>

    <%- include('./partials/footer.ejs') %>
    <script src="/script.js"></script>
  </body>
</html>
