using Connected.Enums;
using Connected.Services;

namespace Connected.Models.Modal;
public class ModalButton
{
	public Event OnClickEvent { get; set; }
	public ModalButtonType ModalButtonType { get; set; } = ModalButtonType.RegularButton;
	public string ButtonText { get; set; }

	public bool CloseDialogOnClick { get; set; } = true;

	public ModalButton(Event OnClickEvent, string ButtonText, ModalButtonType ModalButtonType = ModalButtonType.RegularButton, bool CloseDialogOnClick = true)
	{
		this.OnClickEvent = OnClickEvent;
		this.ButtonText = ButtonText;
		this.ModalButtonType= ModalButtonType;	
		this.CloseDialogOnClick = CloseDialogOnClick;
	}

	public string GetButtonClass
	{
		get
		{
			switch (this.ModalButtonType)
			{
				case ModalButtonType.CancelButton:
					return "btn-sm btn-core";
				case ModalButtonType.OkButton:
					return "btn-sm btn-info";
				default:
					return "btn-sm btn-secondary";
			}
		}
	}
}
