@props([ 'active', 'id' => null, 'mode' => 'create', 'allowedStep' => 1, 'showSaveButton' => false, ]) @php $steps = [ ['key' => 'basic', 'label' => 'بيانات أساسية', 'route' => 'planning.statements.create.basic'], ['key' => 'land', 'label' => 'بيانات قطعة الأرض', 'route' => 'planning.statements.create.land'], ['key' => 'structure', 'label' => 'الشروط التنظيمية للمنشأة', 'route' => 'planning.statements.create.structure'], ['key' => 'coordinates', 'label' => 'الاحداثيات', 'route' => 'planning.statements.create.coordinates'], ]; @endphp
@foreach ($steps as $index => $step) @php $stepIndex = $index + 1; $isActive = $active === $step['key']; $isLocked = ($mode === 'create' && $allowedStep < $stepIndex); $href = route($step['route'], $id ? ['id' => $id] : []); @endphp @if ($isLocked) {{ $step['label'] }} @else $isActive, 'bg-muted/30 text-foreground hover:bg-muted hover:text-primary hover:shadow-sm' => ! $isActive, ]) > {{ $step['label'] }} @endif @endforeach
@if($mode === 'edit' && $id) @can('planning_statements.edit') @endcan @endif @if($mode === 'create') @can('planning_statements.create') @if((int) $allowedStep > 1) @endif @endcan @endif {{ $slot }}