<%- include("templates/cabecera.ejs") %>
<title>Build</title>
</head>
<body>
    <div class="container">
        <h1>Build</h1>
        <div class="row">
            <div class="col-6"><a class="btn btn-success btn-block my-4" href="/builds/crearBuild">Crear una nueva Build</a></div>
            <div class="col-6"><a class="btn btn-success btn-block my-4" href="/menu">Volver</a></div>
        </div>
        <table class="table table-sm text-info">
            <thead class="thead-dark">
                <tr>
                    <th scope="col">#</th>
                    <th scope="col">Nombre</th>
                    <th scope="col">Objetos</th>
                    <th scope="col">Precio Total</th>
                    <th scope="col">Acci√≥n</th>
                </tr>
            </thead>
            <tbody>
                <% if (arrayBuild.length> 0) { %>
                    <!--Haremos el foreach para recorrer el array-->
                    <% arrayBuild.forEach(build=> { %>
                        <tr>
                            <th scope="row">
                                <%= build.id %>
                            </th>
                            <td>
                                <%= build.Nombre %>
                            </td>
                            <td>
                                <%= build.Objetos %>
                            </td>
                            <td>
                                <%= build.PrecioTotal %>
                            </td>
                            <td>
                                <a class="btn btn-warning btn-sm" href="builds/<%= build.id %>/editar">Editar/Eliminar</a>
                            </td>
                        </tr>
                        <% }) %>
                            <% } %>
            </tbody>
        </table>
    </div>
    <%- include("templates/footer.ejs") %>