@extends('crm.layouts.master') @section('title', 'Email — ' . $folderSlug) @section('page-css') @endsection @section('main-content')
@if(!empty($mailboxError)) @endif
{{-- ═══════════ FOLDER SIDEBAR ═══════════ --}} {{-- ═══════════ LIST + PREVIEW ═══════════ --}}
@switch($folderSlug) @case('INBOX') Inbox @break @case('Sent') Sent @break @case('Drafts') Drafts @break @case('Spam') Spam @break @case('Trash') Trash @break @default {{ $folderSlug }} @endswitch
{{ count($emails) }} messages
@forelse($emails as $email) @php $initial = strtoupper(substr($email['sender'] ?: $email['sender_email'], 0, 1)); $colors = ['a','b','c','d','e']; $colorIdx = ord(strtolower($initial ?: 'a')) % 5; $avatarCls= 'avatar-' . $colors[$colorIdx]; $unread = !($email['is_seen'] ?? true); @endphp @empty @endforelse
{{ $folderSlug === 'Sent' ? 'To' : 'From' }} Subject Preview Date
No messages in this folder.
Select an email to read Your message will open here.
{{-- ═══════════ REPLY MODAL ═══════════ --}} {{-- ═══════════ COMPOSE MODAL ═══════════ --}} @endsection @section('page-js') @endsection