<!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">
    <link rel="stylesheet" href="/style.css">
    <link rel="icon" type="imagem/png" href="https://static.vecteezy.com/system/resources/previews/001/200/097/large_2x/book-png.png" />
    <title>Machine Book</title>
</head>
<body>
    <header>
        <div>
        </div>
        <div class="art">
            <img src="https://static.vecteezy.com/system/resources/previews/001/200/097/large_2x/book-png.png" height="35" width="45" alt="book">
            <h1>Machine Book</h1>
        </div>
        
        <nav>
            <ul>
                <li><a href="/adicionar"><b>Adicionar Novo TÃ­tulo</b></a></li>

            </ul>
        </nav>
    </header>
    <% if(message != "") {  %>
        <section id="message">
            <p><%= message %></p> <span id="close">&times;</span>
        </section>
    <% }  %>
    
    <main>
        <% livros.forEach(element => { %>
            <div class="product-container">
                <a href="/detalhes/<%= element.id %> ">
                    <div class="header-container">
                        <img src="<%= element.img %> " height="250" width="250" alt="<%= element.titulo %> ">
                    </div>
                    <div class="main-container">
                        <span class="title-container"> <%= element.titulo %> </span>
                        <br>
                        <span class="autor-container"> <%= element.autores %> </span>
                        <br>
                        <div class="button-container">
                            <a href="/delete/<%= element.id %> "><img class="delete-icon" src="https://cdn-icons-png.flaticon.com/512/18/18297.png" alt="delete-icon"></a>
                            <a href="/editar/<%= element.id %> "> <img class="editar-icon" src="https://cdn-icons-png.flaticon.com/512/1250/1250615.png" alt="editar-icon"></a> 
                        </div>
                    </div>
                </a>
            </div>
        <% }) %>
    </main>
    <footer>
        <b>Todos os direitos reservados a autora Jamile Boffo</b>
    </footer>
    <script src="/public/js/scriptclose.js"></script>
</body>
</html>