@using AIStudio.Components.Settings
@using AIStudio.Settings.DataModel
@attribute [Route(Routes.SETTINGS)]
@inherits MSGComponentBase

<div class="inner-scrolling-context">
    <MudText Typo="Typo.h3" Class="mb-12">@T("Settings")</MudText>

    <InnerScrolling>
        <MudExpansionPanels Class="mb-3" MultiExpansion="@false">
            <SettingsPanelProviders @bind-AvailableLLMProviders="@this.availableLLMProviders"/>

            @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
            {
                <SettingsPanelEmbeddings AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)" @bind-AvailableEmbeddingProviders="@this.availableEmbeddingProviders"/>
            }
            
            @if (PreviewFeatures.PRE_SPEECH_TO_TEXT_2026.IsEnabled(this.SettingsManager))
            {
                <SettingsPanelTranscription AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)" @bind-AvailableTranscriptionProviders="@this.availableTranscriptionProviders"/>
            }
            
            <SettingsPanelApp AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)"/>

            @if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))
            {
                <SettingsPanelAgentDataSourceSelection AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)"/>
                <SettingsPanelAgentRetrievalContextValidation AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)"/>
            }

            <SettingsPanelAgentContentCleaner AvailableLLMProvidersFunc="@(() => this.availableLLMProviders)"/>
        </MudExpansionPanels>
    </InnerScrolling>
</div>