using System.Collections;
using System.Collections.Generic;

using TMPro;
using UnityEngine;
using YandexQuest.Models;
using Zenject;

public class AdminPanel : MonoBehaviour
{
    [SerializeField] private TMP_Text _city;
    [SerializeField] private TMP_InputField _key;

    [Inject] private readonly NetworkService _networkService;
    [Inject] private readonly ClientDataService _clientDataService;

    public async void Initialize(Cities city)
    {
        _city.text = _clientDataService.citiesTranslation[city];
        var result = await _networkService.GetAsync<int>($"auth/secretcode/{(int)city}");
        _key.text = result.responseData.ToString();
    }

    public void CopyToClipboard() => GUIUtility.systemCopyBuffer = _key.text;
}
