mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-23 20:18:24 +00:00
31 lines
825 B
C#
31 lines
825 B
C#
using CSharpFunctionalExtensions;
|
|
using Microsoft.AspNetCore.Components;
|
|
using NftFaucet.Components;
|
|
using NftFaucet.Plugins.Models;
|
|
using Radzen;
|
|
|
|
namespace NftFaucet.Pages;
|
|
|
|
public partial class ConfigurationDialog : BasicComponent
|
|
{
|
|
[Parameter]
|
|
public ConfigurationItem[] ConfigurationItems { get; set; }
|
|
|
|
[Parameter]
|
|
public Func<ConfigurationItem[], Task<Result>> ConfigureAction { get; set; }
|
|
|
|
private async Task OnSavePressed()
|
|
{
|
|
var result = await ConfigureAction(ConfigurationItems);
|
|
if (result.IsSuccess)
|
|
{
|
|
RefreshMediator.NotifyStateHasChangedSafe();
|
|
DialogService.Close((bool?)true);
|
|
}
|
|
else
|
|
{
|
|
NotificationService.Notify(NotificationSeverity.Error, "Invalid configuration", result.Error);
|
|
}
|
|
}
|
|
}
|