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

    <link rel="stylesheet" href="/style.css">
    <link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
    <title>black-market</title>
</head>
<body class="form-body">
    <div class="logo-container">
        <img src="/favicon.ico" class="logo">
        <a href="/" class="root-link">black-market.io</a>
    </div>

    <% if (!locals.product.id) { %>
        <h1>product-not-found...</h1>
    <% } else { %>
        <div class="container view-product">
            <p class="product-name"><%=locals.product.product%></p>
            <div class="image-container">
                <img class="product-image" src="/uploads/<%=locals.product.filename%>">
            </div>
            <p class="product-price"><%=locals.product.price%>$</p>
            <div class="actions">
                <a href="/add-to-cart/<%=locals.product.id%>">
                    <button class="add-to-cart">add-to-cart <i class='bx bx-cart-add'></i></button>
                </a>
                <% if (locals.admin) { %>
                    <a href="/edit/<%=locals.product.id%>">
                        <button class="edit-product">edit <i class='bx bx-edit-alt' ></i></button>
                    </a>
                    <a href="/delete/<%=locals.product.id%>">
                        <button class="delete-product">delete <i class='bx bx-trash' ></i></button>
                    </a>
                <% } %>
            </div>
            <p class="message"><%=locals.message%></p>
            
        </div>
    <% } %>
</body>
</html>