mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-15 13:13:48 +00:00
Refactor components (#80)
This commit is contained in:
1 parent
a18cb22263
commit
1d1af91f3e
137 files changed
+220
-220
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using AIStudio.Settings;
|
||||
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace AIStudio.Components;
|
||||
|
||||
public partial class ProviderSelection : ComponentBase
|
||||
{
|
||||
[Parameter]
|
||||
public Settings.Provider ProviderSettings { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Settings.Provider> ProviderSettingsChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Func<Settings.Provider, string?> ValidateProvider { get; set; } = _ => null;
|
||||
|
||||
[Inject]
|
||||
protected SettingsManager SettingsManager { get; set; } = null!;
|
||||
|
||||
private async Task SelectionChanged(Settings.Provider provider)
|
||||
{
|
||||
this.ProviderSettings = provider;
|
||||
await this.ProviderSettingsChanged.InvokeAsync(provider);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user