@unless($archived ?? false) @php $currentStateForButton = $option->state; $showAccepter = $currentStateForButton === \App\Enums\OptionState::CREATED; $showAnnuler = ! $showAccepter && $currentStateForButton !== \App\Enums\OptionState::EXPIRED && $currentStateForButton !== \App\Enums\OptionState::CONFIRMED && $currentStateForButton !== \App\Enums\OptionState::CANCELED; $canRefuse = $currentStateForButton === \App\Enums\OptionState::CREATED; $hasPrimaryAction = $showAccepter || $showAnnuler; $isSupport = auth()->user()->isRole('ROLE_SUPPORT'); $canModifyDuration = $currentStateForButton !== \App\Enums\OptionState::REFUSED && $currentStateForButton !== \App\Enums\OptionState::CONFIRMED; @endphp @if($hasPrimaryAction)
@if($showAccepter) @elseif($showAnnuler) @endif @include('partner.options.partials.actions-dropdown-menu', ['option' => $option, 'canRefuse' => $canRefuse, 'isSupport' => $isSupport, 'canModifyDuration' => $canModifyDuration])
@else @endif @if($showAccepter) @endif @if($canRefuse) @endif @if($showAnnuler) @endif @if($isSupport) @endif @if($showAccepter) @endif @if($showAnnuler) @endif @if(!($archived ?? false))
@csrf
@endif @if($canRefuse) @endif @endunless