export const cardGamePropia = (nickname, game_id) => {
  var cardGameDiv = document.createElement('div');
  cardGameDiv.classList.add('cardGame');
  cardGameDiv.innerHTML = `<span>${nickname}</span>
      <span class="parpadea">Esperando rival...</span>
      <button class="cancel-game-btn">Cancelar</button>
  `;
  const cancelGameBtn = cardGameDiv.querySelector('.cancel-game-btn');
  cancelGameBtn.addEventListener('click', () => {
    eliminarPartida(game_id);
  });
  return cardGameDiv;
};

export const cardGameGeneral = (nickname, game_id) => {
  var cardGameDiv = document.createElement('div');
  cardGameDiv.classList.add('cardGame');
  cardGameDiv.innerHTML = `<span>${nickname}</span>
      <span>VS</span>
      <button class="join-game-btn">Unirse</button>
  `;
  const joinGameBtn = cardGameDiv.querySelector('.join-game-btn');
  joinGameBtn.addEventListener('click', () => {
    unirsePartida(game_id);
  });
  return cardGameDiv;
};
