<!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="/public/style.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.9.1/font/bootstrap-icons.css">
    <title>Playlist</title>
</head>

<body>

    <nav>
        <ul>
            <li>
                <a href="/"><img src="/public/logomusic.jpg" alt="Playlist"></a>
            </li>
            <li>
                <a href="/admin"><i class="bi bi-command"></i></a>
            </li>
        </ul>
    </nav>

    <section id="player">
        <h2>Sua playlist</h2>

        <div>
            <img id="currentImg" src="/img/musicoff.jpg" alt="">
            <h2 id="currentName">TÃ­tulo</h2>
            <p id="currentArtist">Artista</p>
        </div>

        <div>
            <table>
                <thead>
                    <tr>
                        <th></th>
                        <th>Nome</th>
                        <th>Artista</th>
                        <th></th>
                    </tr>
                </thead>

                <tbody>
                    <% playlist.forEach((music) => {  %>
                        <tr class="musics">
                            <td> <img src="<%= music.linkImage %>" alt="Imagem da Musica"></td>
                            <td>
                                <%= music.name %>
                            </td>
                            <td>
                                 <%= music.autor %>
                            </td>
                            <td>
                                <audio controls class="audio"  src="<%= music.linkMusic %>"></audio>
                            </td>
                        </tr>
                        <% }) %>             
                </tbody>
            </table>
        </div>
    </section>

</body>
</html>