using System;
using TMPro;
using UnityEngine;

public class DropGameConfirmationPanel : MonoBehaviour {
    public TextMeshProUGUI messageText;

    public Action<long> OnConfirm;

    private long _pendingGameId;

    public void Show(long gameId, string message) {
        _pendingGameId = gameId;
        if (messageText != null) { messageText.text = message; }
        gameObject.SetActive(true);
    }

    public void ConfirmClicked() {
        gameObject.SetActive(false);
        OnConfirm?.Invoke(_pendingGameId);
    }

    public void CancelClicked() { gameObject.SetActive(false); }
}
