@extends ('app.my-account.entity-single-layout')

@section('page-sidebar')
@include('app.my-account.admin.orders.partials.sidebar')
@endsection

@section('page-content')
  <div class="px-3">
    <div class="d-flex align-items-center justify-content-between border-bottom px-3 py-2 mb-0 m-neg-3 bg-light">
      <h2 class="font-size-16 text-secondary fw-bold m-0">Order: From {{ $order->user->full_name }}</h2>
      <div>
        @if($order->is_cancelled)
          <span class="text-danger fw-bold">CANCELLED</span>
        @else
          @include("app.my-account.admin.orders.forms.cancel-order")
        @endif
      </div>
    </div>
    <div class="border-bottom m-neg-3 px-3 py-2">
      <div class="d-flex align-items-center justify-content-between">
        <div>
          <span class="mb-0 mr-2 text-muted">Created at:</span>
          <span>{{ friendly_date_time($order->created_at)}}</span>
        </div>
        <div>
          {{-- <a href="{{ route('admin.orders.view.preview-invoice', $order) }}"><i class="fa-solid fa-file-pdf fa-fw"></i> Invoice</a> --}}
        </div>
      </div>
      
    </div>
    <div class="border-bottom m-neg-3 px-3 py-2 d-xl-flex flex-wrap align-items-center mb-3">
     @if($user->is_super_admin)
      <div>
        {{--@include('app.my-account.admin.orders.forms.update-commissions') --}}
        <!-- <span class="mx-1 text-muted">|</span> -->
        @if($order->rep)
          @include('app.my-account.admin.orders.forms.pay-rep')
        @endif
        @if($order->rep && $order->manager)
          <span class="mx-1 text-muted">|</span>
        @endif
        @if($order->manager)
          @include('app.my-account.admin.orders.forms.pay-manager')
        @endif
      </div>
      @endif
    </div>
    @yield('details')
  </div>
@endsection
