@php
    use App\Enums\Invoicing\InvoiceCancellationStatus;
    use App\Enums\Invoicing\InvoiceStatus;

    $labels = [
        InvoiceCancellationStatus::Pending->value   => '(Pendiente)',
        InvoiceCancellationStatus::Verifying->value => '(Comprobando)',
        InvoiceCancellationStatus::Accepted->value => '(Aceptado)',
        InvoiceCancellationStatus::Expired->value   => '(Plazo Vencido)',
        InvoiceCancellationStatus::Rejected->value  => '(Rechazado)',
    ];

    $status_key = $tax_document->cancellation_status?->value;
    $label = $labels[$status_key] ?? '';

    if ($tax_document->status === InvoiceStatus::Canceled && empty($label))
        $label = '(Directo)';
@endphp

@if ($label || $tax_document->status === InvoiceStatus::Canceled)
    <div class="cancelled-watermark text-uppercase">
        Cancelado <small>{{ $label }}</small>
    </div>
@endif
