using Integrations.Components.Features.CreateModuleFeatureMnagement;
using Integrations.Data;

using Microsoft.AspNetCore.Components;
using Microsoft.EntityFrameworkCore;

using MudBlazor;

namespace Integrations.Components.Pages.Integrations;
public partial class CreateIntegrationPage
{
	[Inject]
	private IDialogService DialogService { get; set; } = null!;
	[Inject]
	private DataContext DataContext { get; set; } = null!;
	[Parameter]
	public Guid Id { get; set; }

	private readonly List<Module> _modules = [];

	protected override async Task OnInitializedAsync()
	{
		var modules = await DataContext.Modules
			.AsNoTracking()
			.OrderBy(x => x.Name)
			.ToListAsync();
		_modules.AddRange(modules);
	}

	private async Task OpenCreateDialog()
	{
		var options = new DialogOptions
		{
			CloseOnEscapeKey = true,
			BackdropClick = false,
			CloseButton = true,
			FullScreen = false,
			FullWidth = true,
		};
		await DialogService.ShowAsync<CreateModule>("Add new module", options);
	}

	public record Model(
		
	);
}