<div>
    <?php
        $results_attachment = $order->getDetailJsonValue('results_attachment');
        $user = $order->user;
        $userDetailJson = $user->detailJson();
        $orderDetailJson = $order->detailJson();
        $orderDetailJson->selected_options = json_decode($orderDetailJson->selected_options ?? '{}');
        $orderUserSnapshot = @$orderDetailJson->selected_options->user_snapshot ?? (object) [];
    ?>
    @if(!$results_attachment)
        @include("app.my-account.admin.orders.forms.upload-results-attachment")
    @else
    <div class="d-flex align-items-center">
        <span class="me-1">Report: <i class="fas fa-paperclip fa-fw"></i> 
            <a href="{{ $results_attachment['attachmentAccessTokenUrl'] }}" target="_blank">{{ $results_attachment['orginalFileName'] }}</a>
        </span>
        <div>
            @include("app.my-account.admin.orders.forms.upload-results-attachment", ['edit' => true])
        </div>
        <div class="mx-2">
            @include("app.my-account.admin.orders.forms.delete-results-attachment")
        </div>
        <span class="text-muted mx-1">|</span>
        @if(@$orderUserSnapshot->notification_option === 'phone')
            <div>
                @include('app.my-account.admin.orders.forms.sms-results-attachment')
            </div>
        @else
            <div>
                @include('app.my-account.admin.orders.forms.email-results-attachment')
            </div>
        @endif
    </div>
    @endif
</div>