{{-- Expects: $task, $earnings_invoice_restriction_message (nullable) --}} @foreach ($task['actions'] ?? [] as $action) @php $isPrimary = ($action['tone'] ?? '') === 'primary'; $isPayEarnings = str_contains($action['label'] ?? '', 'mandate earnings'); $blockPay = $isPayEarnings && ! empty($earnings_invoice_restriction_message); $dialogVariant = $action['dialog_variant'] ?? null; $amountDisplay = '$'.number_format((float) ($task['amount_usd'] ?? 0), 2); $dialogPayload = [ 'variant' => $dialogVariant, 'postUrl' => ($action['method'] ?? 'GET') === 'POST' ? $action['url'] : '', 'navigateUrl' => ($action['method'] ?? 'GET') === 'GET' ? $action['url'] : '', 'buttonLabel' => $action['label'] ?? '', 'taskTitle' => $task['title'] ?? '', 'taskSummary' => $task['summary'] ?? '', 'taskStatus' => $task['status'] ?? '', 'amountDisplay' => $amountDisplay, 'taskKind' => $task['kind'] ?? '', ]; @endphp @if ($dialogVariant) @elseif (($action['method'] ?? 'GET') === 'POST')
@csrf
@else {{ $action['label'] }} @endif @endforeach