Output (/order)
Import JSON @CancelButtonText @SendButtonText @(Copied ? "Copied!" : "Copy")
@code { [Parameter] public string OrderJson { get; set; } = ""; [Parameter] public bool Copied { get; set; } [Parameter] public bool? SendSuccess { get; set; } [Parameter] public bool DisableCancel { get; set; } [Parameter] public bool? CancelSuccess { get; set; } [Parameter] public EventCallback OrderJsonChanged { get; set; } [Parameter] public EventCallback OnCopy { get; set; } [Parameter] public EventCallback OnSend { get; set; } [Parameter] public EventCallback OnImport { get; set; } [Parameter] public EventCallback OnCancel { get; set; } private string SendButtonText => SendSuccess switch { true => "Done", false => "Error", _ => "Send" }; private Color SendButtonColor => SendSuccess switch { true => Color.Success, false => Color.Error, _ => Color.Success }; private string SendButtonIcon => SendSuccess switch { true => Icons.Material.Filled.CheckCircle, false => Icons.Material.Filled.Error, _ => Icons.Material.Filled.Send }; private string CancelButtonText => CancelSuccess switch { true => "Done", false => "Error", _ => "Cancel" }; private Color CancelButtonColor => CancelSuccess switch { true => Color.Success, false => Color.Error, _ => Color.Error }; private string CancelButtonIcon => CancelSuccess switch { true => Icons.Material.Filled.CheckCircle, false => Icons.Material.Filled.Error, _ => Icons.Material.Filled.Cancel }; private void OrderJsonChange(string value) { OrderJson = value; OrderJsonChanged.InvokeAsync(OrderJson); StateHasChanged(); } }