58 lines
3.0 KiB
PHP
58 lines
3.0 KiB
PHP
@extends('layouts.frontend')
|
|
@section('title', 'Pesan Saya')
|
|
|
|
@section('content')
|
|
<div class="container py-5">
|
|
<h2 class="mb-4 fw-bold text-dark">Pesan Saya</h2>
|
|
|
|
<div class="row g-0 chat-container">
|
|
<div class="col-md-4 chat-sidebar">
|
|
<div class="p-3 bg-white sticky-top border-bottom">
|
|
<input type="text" class="form-control rounded-pill" placeholder="Cari pesan...">
|
|
</div>
|
|
|
|
<div class="list-group list-group-flush">
|
|
@forelse($chatList as $chat)
|
|
<a href="{{ route('pembeli.pesan.show', $chat['lawan_id']) }}"
|
|
class="list-group-item list-group-item-action chat-list-item py-3">
|
|
<div class="d-flex align-items-center">
|
|
<div class="position-relative">
|
|
<img src="{{ asset('template/frontend/img/avatar.jpg') }}" class="rounded-circle"
|
|
width="50" height="50" style="object-fit: cover;">
|
|
@if ($chat['unread'] > 0)
|
|
<span
|
|
class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">
|
|
{{ $chat['unread'] }}
|
|
</span>
|
|
@endif
|
|
</div>
|
|
<div class="ms-3 flex-grow-1 overflow-hidden">
|
|
<div class="d-flex justify-content-between align-items-center mb-1">
|
|
<h6 class="mb-0 text-dark fw-bold text-truncate">{{ $chat['nama'] }}</h6>
|
|
<small class="text-muted" style="font-size: 0.75rem;">{{ $chat['time'] }}</small>
|
|
</div>
|
|
<p class="mb-0 text-muted text-truncate small">
|
|
{{ Str::limit($chat['last_message'], 35) }}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
@empty
|
|
<div class="text-center py-5 px-3">
|
|
<p class="text-muted">Belum ada percakapan.</p>
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-8 d-none d-md-flex flex-column align-items-center justify-content-center bg-white">
|
|
<div class="text-center opacity-50">
|
|
<i class="fa fa-comments fa-4x text-success mb-3"></i>
|
|
<h5>Selamat Datang di Chat</h5>
|
|
<p>Pilih salah satu percakapan di sebelah kiri<br>untuk melihat detail pesan.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|