@extends('layouts.app') @section('title', 'Dashboard') @section('page-title', 'Overview') @section('content') {{-- Stats Cards --}}
@php $cards = [ ['label'=>'Pending Replies','value'=>$stats['pending_replies'],'color'=>'red','icon'=>'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z'], ['label'=>'Commitments','value'=>$stats['commitments'],'color'=>'amber','icon'=>'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2'], ['label'=>'Follow-ups','value'=>$stats['followups'],'color'=>'blue','icon'=>'M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'], ['label'=>'Total Messages','value'=>$stats['total_messages'],'color'=>'emerald','icon'=>'M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z'], ]; $colorMap = ['red'=>'text-red-400 bg-red-500/10 border-red-500/20','amber'=>'text-amber-400 bg-amber-500/10 border-amber-500/20','blue'=>'text-blue-400 bg-blue-500/10 border-blue-500/20','emerald'=>'text-emerald-400 bg-emerald-500/10 border-emerald-500/20']; @endphp @foreach($cards as $card)

{{ $card['label'] }}

{{ $card['value'] }}

@endforeach
{{-- Connections Banner --}} @if(!$stats['gmail_connected'] || !$stats['whatsapp_connected'])

Connect your accounts to get started

Link Gmail and WhatsApp to start syncing conversations.

@if(!$stats['gmail_connected']) Connect Gmail @endif @if(!$stats['whatsapp_connected']) Connect WhatsApp @endif
@endif
{{-- Pending Replies --}}

Pending Replies @if($stats['pending_replies'] > 0) {{ $stats['pending_replies'] }} @endif

@forelse($pendingReplies as $conv)
{{ strtoupper(substr($conv->contact_name ?: '?', 0, 1)) }}

{{ $conv->contact_name ?: $conv->contact_identifier }}

{{ $conv->last_message_at?->diffForHumans() }}

@if($conv->subject)

{{ $conv->subject }}

@endif

{{ $conv->snippet }}

View
@empty

🎉 No pending replies. All caught up!

@endforelse
{{-- Right Column --}}
{{-- Commitments --}}

Commitments

@forelse($commitments->take(5) as $commitment)

{{ $commitment->description }}

{{ $commitment->made_by === 'me' ? 'I promised' : 'They promised' }} @if($commitment->due_date) {{ $commitment->due_date->format('M d') }} @endif
@csrf
@empty

No pending commitments

@endforelse
{{-- Follow-ups --}}

Follow-ups

@forelse($followups->take(5) as $task)

{{ $task->title }}

@if($task->due_date)

Due {{ $task->due_date->format('M d') }}

@endif
@csrf
@empty

No follow-ups needed

@endforelse
{{-- Recent Conversations --}}

Recent Conversations

@forelse($recent as $conv)
{{ strtoupper(substr($conv->contact_name ?: '?', 0, 1)) }}

{{ $conv->contact_name ?: $conv->contact_identifier }}

@if($conv->source === 'gmail') Gmail @else WhatsApp @endif @if($conv->has_pending_reply) Reply needed @endif

{{ $conv->snippet }}

{{ $conv->last_message_at?->diffForHumans() }}

@empty

No conversations yet

Connect Gmail or WhatsApp to start syncing.

@endforelse
@endsection