@props([ 'id' => 'workerPickerModal', ]) @php $allWorkers = \App\Models\Worker::with('contractor')->orderBy('full_name')->get()->map(function($w) { return [ 'id' => $w->id, 'code' => $w->worker_code, 'name' => $w->full_name, 'national_id' => $w->national_id ?? '', 'phone' => $w->phone ?? '', 'wage_type' => $w->wage_type === 'hourly' ? 'بالساعة' : 'يومي', 'rate' => number_format((float)$w->wage_rate, 2), 'contractor' => $w->contractor?->name ?? 'مباشر (إدارة الشركة)', 'status' => $w->status ?? 'active', 'status_label' => ($w->status === 'frozen' ? 'مجمد' : ($w->status === 'blacklisted' ? 'محظور' : 'نشط')), ]; }); @endphp