using Employees;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

namespace UI.Employee
{
    public class EmployeeHiredDetails : EmployeeDetails
    {
        [Header("Our Worker Settings")]
        [SerializeField] private Button upgradeTimeOnEventButton;
        [SerializeField] private Button upgradeMaxEventsPerWeekButton;

        public void Init(EmployeeData data, Sprite sp, UnityAction onRelease, UnityAction onUpgradeTime, UnityAction onUpgradeEvents)
        {
            base.Init(data, sp, onRelease);

            upgradeTimeOnEventButton.onClick.RemoveAllListeners();
            upgradeMaxEventsPerWeekButton.onClick.RemoveAllListeners();

            upgradeTimeOnEventButton.onClick.AddListener(() => onUpgradeTime?.Invoke());
            upgradeMaxEventsPerWeekButton.onClick.AddListener(() => onUpgradeEvents?.Invoke());
        }
    }
}