using Bit.BlazorUI;
using JSMR.UI.Blazor;
using JSMR.UI.Blazor.Services;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using MudBlazor.Services;
using Radzen;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

string apiBase = builder.Configuration["ApiBaseUrl"] ?? builder.HostEnvironment.BaseAddress;

Console.WriteLine(apiBase);

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(apiBase) });
builder.Services.AddMudServices();
builder.Services.AddRadzenComponents();
builder.Services.AddBitBlazorUIServices();

builder.Services.AddScoped<VoiceWorksClient>();
builder.Services.AddScoped<ILookupDataService, LookupDataService>();

await builder.Build().RunAsync();