Add default configuration for assistants (#52)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-07-28 11:20:00 +02:00
1 parent a1c4618796
commit b3b8bf23dc
42 files changed
+729 -138

No files matched your search

@@ -1,40 +0,0 @@
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components;
/// <summary>
/// Configuration component for any boolean option.
/// </summary>
public partial class ConfigurationOption : ConfigurationBase
{
/// <summary>
/// Text to display when the option is true.
/// </summary>
[Parameter]
public string LabelOn { get; set; } = string.Empty;
/// <summary>
/// Text to display when the option is false.
/// </summary>
[Parameter]
public string LabelOff { get; set; } = string.Empty;
/// <summary>
/// The boolean state of the option.
/// </summary>
[Parameter]
public Func<bool> State { get; set; } = () => false;
/// <summary>
/// An action which is called when the option is changed.
/// </summary>
[Parameter]
public Action<bool> StateUpdate { get; set; } = _ => { };
private async Task OptionChanged(bool updatedState)
{
this.StateUpdate(updatedState);
await this.SettingsManager.StoreSettings();
await this.InformAboutChange();
}
}