function responseSavedTeams(teams) {
    // Menyusun komponen card team secara dinamis
    let teamsHTML = "";
    teams.forEach(function (team) {
        let logoUri = team.crestUrl;
        logoUri = logoUri.replace(/^http:\/\//i, 'https://');
        teamsHTML += `
            <div class="col s12 m6">
                <div class="card">
                    <a href="./team.html?id=${team.id}&saved=true">
                        <div class="card-image waves-effect waves-block waves-light">
                            <img src="${logoUri}" class="logo-image" alt="Logo" />
                        </div>
                        <div class="card-content color-black">
                            <span class="card-title truncate">${team.name}</span>
                            <p>${team.venue}</p>
                        </div>
                    </a>
                </div>
            </div>
        `;
    });

    // cek jika team belum ada yang disimpan
    if (teams.length === 0) {
        teamsHTML += `
            <div class="col s12 m6">
                <div class="card p3 center-align">
                    <b>Belum ada team yang disimpan.</b>
                </div>
            </div>
        `;
    }

    // Sisipkan komponen card ke dalam elemen dengan id #body-content
    document.getElementById("body-content").innerHTML = teamsHTML;
}
// Blok kode response dari saved teams
Blok kode response dari saved teams
Blok kode response dari saved teams
function responseSavedTeams(teams) {
    let teamsHTML = "";
    teams.forEach(function (team) {
        let logoUri = team.crestUrl;
        logoUri = logoUri.replace(/^http:\/\//i, 'https://');
        teamsHTML += `
            <div class="col s12 m6">
                <div class="card">
                    <a href="./team.html?id=${team.id}&saved=true">
                        <div class="card-image waves-effect waves-block waves-light">
                            <img src="${logoUri}" class="logo-image" alt="Logo" />
                        </div>
                        <div class="card-content color-black">
                            <span class="card-title truncate">${team.name}</span>
                            <p>${team.venue}</p>
                        </div>
                    </a>
                </div>
            </div>
        `;
    });
    if (teams.length === 0) {
        teamsHTML += `
            <div class="col s12 m6">
                <div class="card p3 center-align">
                    <b>Belum ada team yang disimpan.</b>
                </div>
            </div>
        `;
    }
    document.getElementById("body-content").innerHTML = teamsHTML;
}
function responseSavedTeams ( teams ) { let teamsHTML = "" ; teams . forEach ( function ( team ) { let logoUri = team . crestUrl ; logoUri = logoUri . replace ( / ^http:\/\/ / i , 'https://' ) ; teamsHTML += ` ${ team . id } ${ logoUri } ${ team . name } ${ team . venue } ` ; } ) ; if ( teams . length === 0 ) { teamsHTML += ` ` ; } document . getElementById ( "body-content" ) . innerHTML = teamsHTML ; }
Blok kode response dari saved teams
Blok kode response dari saved teams
// Menyusun komponen card team secara dinamis // cek jika team belum ada yang disimpan // Sisipkan komponen card ke dalam elemen dengan id #body-content