<!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">
    <title>Document</title>
    <link rel="stylesheet" href="/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/style.css">
</head>
<body>
    <nav class="navbar navbar-light bg-primary">
        <a class="navbar-brand" href="/">
            <img id="logo" src="/img/logo.png" alt="Logo do site">
        </a>

    </nav>
    <div class="container">
        <hr>
        <h1>Bem vindo ao site de perguntas e respostas</h1>
        <h3>Para realizar uma pergunta clique no bot√£o abaixo</h3>
        <hr>
        <a href="/perguntar" class="btn btn-primary">Perguntar</a>

        <% perguntas.forEach(pergunta =>{ %>
            <hr>
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">
                        <%= pergunta.titulo %>
                    </h5>
                        <h6 class="card-subtitle mb-2 text-muted">
                            <%= pergunta.createdAt %>
                        </h6>
                </div>
                <div class="card-footer">
                    <a href="/pergunta/<%= pergunta.id %>"><button class="btn btn-primary">Responder</button></a>
                </div>
            <div>

        <% }) %>
    </div>
</body>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script>
</html>