@namespace BackOffice.Pages.Payment.Components

@using MudBlazor

<MudDialog>
    <DialogContent>
        @if (Model is not null)
        {
            <MudStack Spacing="2">
                <MudText Typo="Typo.h6">جزئیات تراکنش</MudText>
                <MudText Typo="Typo.body2">شناسه: @Model.Id</MudText>
                <MudText Typo="Typo.body2">RefId: @Model.RefId</MudText>
                <MudText Typo="Typo.body2">مبلغ: @Model.Amount.ToString("N0") تومان</MudText>
                <MudText Typo="Typo.body2">وضعیت: @StatusText</MudText>
                <MudText Typo="Typo.body2">تاریخ پرداخت: @Model.PaymentDate.ToLocalTime().MiladiToJalaliWithTime()</MudText>

                @if (!string.IsNullOrWhiteSpace(Model.BankReferenceId))
                {
                    <MudText Typo="Typo.body2">BankReferenceId: @Model.BankReferenceId</MudText>
                }

                @if (!string.IsNullOrWhiteSpace(Model.TrackingCode))
                {
                    <MudText Typo="Typo.body2">TrackingCode: @Model.TrackingCode</MudText>
                }

                @if (Model.PaymentFailed && !string.IsNullOrWhiteSpace(Model.PaymentFailedReason))
                {
                    <MudAlert Severity="Severity.Error">
                        دلیل خطا: @Model.PaymentFailedReason
                    </MudAlert>
                }
            </MudStack>
        }
    </DialogContent>
    <DialogActions>
        <MudButton Variant="Variant.Outlined" Color="Color.Default" OnClick="Close">
            بستن
        </MudButton>
    </DialogActions>
</MudDialog>

