@php $companies = $companies ?? collect(); $kpis = $kpis ?? ['total' => 0, 'with_deals' => 0, 'won_value' => 0]; $q = $q ?? ''; @endphp
{{-- Header --}}
{{ __('CRM · Organizations') }}

{{ __('Companies') }}

{{ __('Group contacts and deals under an organization — see every contact, open deal and won revenue in one place.') }}

{{-- KPIs --}}
@foreach ([ ['label' => __('Companies'), 'value' => number_format($kpis['total'])], ['label' => __('With open deals'), 'value' => number_format($kpis['with_deals'])], ['label' => __('Won revenue'), 'value' => number_format($kpis['won_value'], 2)], ] as $kpi)
{{ $kpi['label'] }}
{{ $kpi['value'] }}
@endforeach
{{-- Search --}}
{{-- List --}}
@forelse ($companies as $co) {{-- Delete — stopPropagation so the row's navigate onclick doesn't also fire. --}} @empty @endforelse
{{ __('Company') }} {{ __('Industry') }} {{ __('Contacts') }} {{ __('Open deals') }} {{ __('Won value') }} {{ __('Actions') }}
{{ $co['name'] }} {{ $co['industry'] ?: '—' }} {{ number_format($co['contacts']) }} {{ number_format($co['open_deals']) }} {{ number_format($co['won_value'], 2) }}
@csrf @method('DELETE')
{{ __('No companies yet. Create your first one.') }}
{{-- New-company modal --}}