diff --git a/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor b/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor new file mode 100644 index 00000000..73d07be2 --- /dev/null +++ b/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor @@ -0,0 +1,18 @@ +@inherits ConfigurationBase + + \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor.cs b/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor.cs new file mode 100644 index 00000000..228fa133 --- /dev/null +++ b/app/MindWork AI Studio/Components/Blocks/ConfigurationText.razor.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Components; + +namespace AIStudio.Components.Blocks; + +public partial class ConfigurationText : ConfigurationBase +{ + /// + /// The text used for the textfield. + /// + [Parameter] + public Func Text { get; set; } = () => string.Empty; + + /// + /// An action which is called when the option is changed. + /// + [Parameter] + public Action TextUpdate { get; set; } = _ => { }; + + /// + /// The icon to display next to the textfield. + /// + [Parameter] + public string Icon { get; set; } = Icons.Material.Filled.Info; + + /// + /// The color of the icon to use. + /// + [Parameter] + public Color IconColor { get; set; } = Color.Default; + + private async Task OptionChanged(string updatedText) + { + this.TextUpdate(updatedText); + await this.SettingsManager.StoreSettings(); + await this.InformAboutChange(); + } +} \ No newline at end of file