@extends('layouts.app') @section('title', 'Dashboard') @section('content') {{-- Page Header --}} {{-- Stats Cards --}}
{{ number_format($totalContacts) }}
Total Kontak
@if($newLeadsToday > 0)
+{{ $newLeadsToday }} hari ini
@endif
{{ number_format($openDeals) }}
Deal Aktif
Rp {{ number_format($dealsValueOpen / 1000000, 1) }}jt pipeline
{{ number_format($pendingTasks) }}
Tugas Pending
@if($overdueTasks > 0)
{{ $overdueTasks }} terlambat
@else
Semua on-track
@endif
{{ number_format($unreadWa) }}
Pesan WA Belum Dibaca
{{ $chatbotToday['total'] }} bot replies hari ini
{{-- Charts Row --}}
{{-- Sales Chart --}}
Deal Won — 7 Hari Terakhir Lihat Laporan
{{-- Contact Source Donut --}}
Sumber Kontak
@foreach($contactSources as $src)
{{ \App\Models\Contact::SOURCE_LABELS[$src->source] ?? $src->source }} {{ $src->total }}
@endforeach @if($contactSources->isEmpty())

Belum ada data

@endif
{{-- Pipeline Bar --}}
Pipeline per Stage Kanban View
@if($pipeline->isEmpty())

Belum ada data pipeline.

@else
@foreach($pipeline as $stage)
{{ $stage->name }}
{{ $stage->deals_count }}
Rp {{ number_format(($stage->deals_value ?? 0) / 1000000, 1) }}jt
@endforeach
@endif
{{-- Bottom Row --}}
{{-- Recent Contacts --}}
Kontak Terbaru Semua
@if($recentContacts->isEmpty())

Belum ada kontak

@else
@foreach($recentContacts as $contact)
{{ strtoupper(substr($contact->name, 0, 2)) }}
{{ $contact->name }}
{{ $contact->phone }}
{{ $contact->status_label }}
@endforeach
@endif
{{-- Upcoming Tasks --}}
Tugas Mendatang Semua
@if($upcomingTasks->isEmpty())

Tidak ada tugas pending

@else
@foreach($upcomingTasks as $task)
{{ $task->title }}
{{ $task->due_at ? $task->due_at->locale('id')->diffForHumans() : 'Tanpa deadline' }}
{{ ucfirst($task->priority) }}
@endforeach
@endif
{{-- Recent WA --}}
WA Inbox Terbaru Inbox
@if($recentConversations->isEmpty())

Tidak ada percakapan aktif

@else
@foreach($recentConversations as $conv)
@if($conv->unread_count > 0) {{ min($conv->unread_count, 9) }} @endif
{{ $conv->display_name }}
{{ Str::limit($conv->last_message, 30) }}
{{ $conv->last_message_at?->locale('id')->diffForHumans(short: true) }}
@endforeach
@endif
@endsection @push('scripts') @endpush