<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
      crossorigin="anonymous"
    />
    <script defer
      src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
      integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
      crossorigin="anonymous"
    ></script>

    <link rel="stylesheet" href="..\..\stylesheets\wishlist.css">
    <script src="..\..\scripts\wishlist.js"></script>

    <link rel="stylesheet" href="..\..\stylesheets\index.css">
    <script src="..\..\scripts\index.js"></script>

    <title>Wishlist</title>
</head>

<body>
  <div class="container-fluid" style="height: 100vh;">
    <div class="row h-100">
      <%- include('navbar') %>

      <!-- Content -->
      <div class="col-9 scrollable-column p-5" style="background-color: aqua;">

        <div class="row mb-4">
          <div class="col-2">
            <button class="btn btn-primary">Create List</button>
          </div>
          <div class="col-1">
            <div class="dropdown show">
              <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Choose List
              </a>
              <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                <a class="dropdown-item" href="#">Action</a>
                <a class="dropdown-item" href="#">Another action</a>
                <a class="dropdown-item" href="#">Something else here</a>
              </div>
            </div>
          </div>
          <div class="col-7"></div>
          <div class="col-2">
            <button class="btn btn-primary">
              <a href="../store/cart.ejs" style="text-decoration: none; color: white;">
                Go to Cart
              </a>
            </button>
          </div>
        </div>

        <div class="row">
          <h1>My Wishlist</h1>
        </div>

        <!-- Order Items and Page Navigation -->
        <div class="row">
          <div class="col">
            <div class="dropdown show">
              <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                Order Items
              </a>
              <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
                <a class="dropdown-item" href="#">Action</a>
                <a class="dropdown-item" href="#">Another action</a>
                <a class="dropdown-item" href="#">Something else here</a>
              </div>
            </div>
          </div>
        </div>


        <!-- Items in Wishlist -->
        <% for (product of products) { %>
        <div class="row">
          <div class="row">
            <div class="col-sm-2 my-auto">
              <form class="row" method="post" action=<%= "/store/cart/add/" + product.productid %>>
                <button class="btn btn-primary"> Add to Cart </button>
              </form>
              <form class="row" method="get" action=<%= "wishlist/delete/" + product.productid %>>
                <button class="btn btn-danger"> Delete </button>
              </form>
            </div>
            <div class="col-10">
                <div class="card m-2">
                  <div class="card-body">
                  <div class="row">
                    <div class="col-2">
                      <div style="height: 190px; width: 140px; background-color: red;">
                        <img style="height: 100%; width: 100%;" src=<%= "../../images/products/" + product.productimage %>>
                      </div>
                    </div>
                    <div class="col-sm-10 my-auto">
                      <div class="row">
                        <div class="col-10">
                          <a href=<%= "/store/product/" + product.productid %>>
                            <h4><%= product.productname %></h4>
                          </a>
                          <h6><%= product.publisherid %></h6>
                        </div>
                        <div class="col-2">
                          <h4>$<%= product.productprice %></h4>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <% } %>
      </div>
    </div>
  </div>
  </div>


  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
    crossorigin="anonymous"></script>
</body>

</html>