using IntegryApiClient.Blazor;
using Fixiy.Web.Components;
using Fixiy.Shared.Interfaces;
using Fixiy.Web.Services;

const string appToken = "3e7e7147-1391-48e7-86bd-b70e7418d40d";

var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
builder.Services.AddRazorComponents()
    .AddInteractiveServerComponents();

builder.Services.UseIntegry(appToken: appToken, useLoginAzienda: true);

builder.Services.AddScoped<IFormFactor, FormFactor>();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Error", createScopeForErrors: true);
    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
    app.UseHsts();
}

app.UseHttpsRedirection();

app.UseStaticFiles();
app.UseAntiforgery();

app.MapRazorComponents<App>()
    .AddInteractiveServerRenderMode()
    .AddAdditionalAssemblies(typeof(Fixiy.Shared._Imports).Assembly);

app.Run();