@php $guidance = is_array($guidance ?? null) ? $guidance : []; $primaryAction = is_array($guidance['primary_action'] ?? null) ? $guidance['primary_action'] : []; $secondaryActions = is_array($guidance['secondary_actions'] ?? null) ? $guidance['secondary_actions'] : []; $technicalDetails = is_array($guidance['technical_details'] ?? null) ? $guidance['technical_details'] : []; $inlinePrimaryAction = (bool) ($inlinePrimaryAction ?? false); $severity = (string) ($guidance['severity'] ?? 'warning'); $status = (string) ($guidance['status'] ?? ''); $title = (string) ($guidance['title'] ?? ''); $reason = (string) ($guidance['reason'] ?? ''); $impact = (string) ($guidance['impact'] ?? ''); $actionName = is_string($primaryAction['action_name'] ?? null) ? (string) $primaryAction['action_name'] : null; $primaryActionUrl = is_string($primaryAction['url'] ?? null) ? (string) $primaryAction['url'] : null; $primaryActionLabel = (string) ($primaryAction['label'] ?? ''); $primaryActionType = (string) ($primaryAction['type'] ?? ''); $primaryActionHeading = ($primaryActionType === 'none' || ($actionName === null && $primaryActionUrl === null)) ? __('localization.accepted_risk_guidance.review_focus_label') : __('localization.accepted_risk_guidance.primary_action_label'); [$badgeColor, $accentClasses] = match ($severity) { 'success' => [ 'success', 'border-l-success-500 dark:border-l-success-400', ], 'danger' => [ 'danger', 'border-l-danger-500 dark:border-l-danger-400', ], default => [ 'warning', 'border-l-warning-500 dark:border-l-warning-400', ], }; @endphp
@if ($status !== '') {{ $status }} @endif @if ($title !== '')

{{ $title }}

@endif
@if ($reason !== '')
{{ __('localization.accepted_risk_guidance.reason_label') }}

{{ $reason }}

@endif @if ($impact !== '')
{{ __('localization.accepted_risk_guidance.impact_label') }}

{{ $impact }}

@endif @if ($technicalDetails !== [])
@foreach ($technicalDetails as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@endif
{{ $primaryActionHeading }}
@if ($inlinePrimaryAction && $actionName !== null) {{ $primaryActionLabel }} @elseif ($primaryActionUrl !== null) {{ $primaryActionLabel }} @elseif ($primaryActionLabel !== '')
{{ $primaryActionLabel }}
@endif @if ($secondaryActions !== [])
{{ __('localization.accepted_risk_guidance.secondary_actions_label') }}
@foreach ($secondaryActions as $secondaryAction) @php if (! is_array($secondaryAction)) { continue; } $secondaryUrl = is_string($secondaryAction['url'] ?? null) ? (string) $secondaryAction['url'] : null; $secondaryLabel = (string) ($secondaryAction['label'] ?? ''); @endphp @if ($secondaryUrl !== null && $secondaryLabel !== '') {{ $secondaryLabel }} @endif @endforeach
@endif