using FNZCM.BlazorWasm.Helpers;
using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;

namespace FNZCM.BlazorWasm.UI.Components.Bases
{
    public class FnzComponentBase : ComponentBase
    {
        [Inject] protected IJSRuntime JSRuntime { get; set; }
        [Inject] protected ApiClient ApiClient { get; set; }
        [Inject] protected FnzDataSetSingleto DataSet { get; set; }
        [Inject] protected LocalStorageHelper LocalStorage { get; set; }
        [Inject] protected PlaylistHelper PlaylistHelper { get; set; }
        [Inject] protected NavigationManager NavigationManager { get; set; }

        [Parameter(CaptureUnmatchedValues = true)]
        public Dictionary<string, object> InputAttributes { get; set; }

        public ElementReference? Element { get; protected set; }

        protected virtual string Prefix => "fnz";

        public Guid InstanceId { get; } = Guid.NewGuid();
        public string ElementId => Prefix.Replace(".", "-") + "-" + InstanceId.ToString("n");
    }
}
