This commit is contained in:
2025-12-22 09:49:02 +07:00
parent f6f8a3bf65
commit 7e0c6af9d5
6 changed files with 315 additions and 18 deletions

View File

@@ -5,7 +5,16 @@
<div class="d-flex gap-2">
<!-- ================= SEND BUTTON ================= -->
<!-- IMPORT -->
<MudButton Variant="Variant.Outlined"
Color="Color.Secondary"
Size="Size.Small"
StartIcon="@Icons.Material.Filled.UploadFile"
OnClick="OnImport">
Import JSON
</MudButton>
<!-- SEND -->
<MudButton Variant="Variant.Filled"
Color="@SendButtonColor"
StartIcon="@SendButtonIcon"
@@ -14,7 +23,7 @@
@SendButtonText
</MudButton>
<!-- ================= COPY ================= -->
<!-- COPY -->
<MudTooltip Text="@(Copied ? "Copied!" : "Copy to clipboard")">
<MudButton Variant="Variant.Filled"
Color="@(Copied ? Color.Success : Color.Primary)"
@@ -27,15 +36,14 @@
</div>
</MudStack>
<!-- ================= JSON ================= -->
<div class="flex-grow-1" style="overflow:auto;">
<MudTextField Value="@OrderJson"
ReadOnly="true"
ReadOnly
Variant="Variant.Filled"
Lines="70"
Class="h-100"
Style="font-family: 'Roboto Mono', Consolas, 'Courier New', monospace;
font-size: 0.875rem;
Style="font-family: 'Roboto Mono', Consolas, monospace;
font-size: 0.85rem;
background:#1e1e1e;
color:#d4d4d4;" />
</div>
@@ -45,10 +53,11 @@
[Parameter] public string OrderJson { get; set; } = "";
[Parameter] public bool Copied { get; set; }
[Parameter] public bool? SendSuccess { get; set; }
[Parameter] public EventCallback OnCopy { get; set; }
[Parameter] public EventCallback OnSend { get; set; }
[Parameter] public EventCallback OnImport { get; set; }
// ================= SEND BUTTON STATE =================
private string SendButtonText =>
SendSuccess switch
{