using Microsoft.AspNetCore.Components; namespace AIStudio.Components; /// /// Configuration component for selecting a value from a list. /// /// The type of the value to select. public partial class ConfigurationSelect : ConfigurationBase { /// /// The data to select from. /// [Parameter] public IEnumerable> Data { get; set; } = []; /// /// The selected value. /// [Parameter] public Func SelectedValue { get; set; } = () => default!; /// /// An action that is called when the selection changes. /// [Parameter] public Action SelectionUpdate { get; set; } = _ => { }; private async Task OptionChanged(T updatedValue) { this.SelectionUpdate(updatedValue); await this.SettingsManager.StoreSettings(); await this.InformAboutChange(); } private static string GetClass => $"{MARGIN_CLASS} rounded-lg"; }