mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 23:49:06 +00:00
24 lines
589 B
C#
24 lines
589 B
C#
|
using Microsoft.AspNetCore.Components;
|
||
|
|
||
|
namespace AIStudio.Components;
|
||
|
|
||
|
public partial class ConfigurationTrigger : ConfigurationBase
|
||
|
{
|
||
|
[Parameter]
|
||
|
public string TriggerText { get; set; } = string.Empty;
|
||
|
|
||
|
[Parameter]
|
||
|
public string TriggerIcon { get; set; } = Icons.Material.Filled.AddBox;
|
||
|
|
||
|
[Parameter]
|
||
|
public Action OnClickSync { get; set; } = () => { };
|
||
|
|
||
|
[Parameter]
|
||
|
public Func<Task> OnClickAsync { get; set; } = () => Task.CompletedTask;
|
||
|
|
||
|
private async Task Click()
|
||
|
{
|
||
|
this.OnClickSync();
|
||
|
await this.OnClickAsync();
|
||
|
}
|
||
|
}
|