using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

namespace UI.Employee
{
    public class EmployeeInfoButton : MonoBehaviour
    {
        [SerializeField] private Image icon;
        [SerializeField] private TextMeshProUGUI nameText;
        [SerializeField] private TextMeshProUGUI salaryText;
        [SerializeField] private Button button;

        public void Init(Employees.EmployeeData data, Sprite sp, UnityAction onClick)
        {
            icon.sprite = sp;
            nameText.text = data.fullname;
            salaryText.text = data.salary.ToString();

            button.onClick.AddListener(onClick);
        }
    }
}