@extends('frontend.layout.dashboard-master') @section('site_title', __('My Reviews')) @section('content') {{-- Header --}}

{{ __('My Reviews') }}

{{ __('All reviews clients have left on your completed orders') }}

{{-- Stats --}}

{{ __('Total Reviews') }}

{{ $stats->total ?? 0 }}

{{ __('Average Rating') }}

{{ $stats->total ? number_format($stats->average, 1) : '—' }}

@if($stats->total)
@php $avg = round(($stats->average ?? 0) * 2) / 2; @endphp @for($i = 1; $i <= 5; $i++) @if($avg >= $i) @elseif($avg >= $i - 0.5) @else @endif @endfor
@endif

{{ __('Pending Replies') }}

{{ $pending_count }}

{{-- Review list --}} @if($reviews->count() > 0)
@foreach($reviews as $review) @php $client = $review->order?->user; $reply = $reply_map[$review->order_id] ?? null; $stars = round($review->rating * 2) / 2; if ($client?->image) { if (cloudStorageExist() && in_array(\Illuminate\Support\Facades\Storage::getDefaultDriver(), ['s3','cloudFlareR2','wasabi'])) { $avatar = render_frontend_cloud_image_if_module_exists('profile/'.$client->image, load_from: $client->load_from ?? ''); } else { $avatar = asset('assets/uploads/profile/'.$client->image); } } else { $avatar = asset('assets/static/img/author/author.jpg'); } @endphp
{{-- Top row: client info + rating + date --}}
{{ $client?->first_name }}

{{ $client?->first_name }} {{ $client?->last_name }}

@if($client?->user_verified_status) @endif

{{ $review->created_at->toFormattedDateString() }}

{{-- Stars --}}
@for($i = 1; $i <= 5; $i++) @if($stars >= $i) @elseif($stars >= $i - 0.5) @else @endif @endfor
{{ number_format($review->rating, 1) }}
{{-- Reply status badge --}} @if($reply) {{ __('Replied') }} @else {{ __('Pending Reply') }} @endif
{{-- Review text --}} @if($review->review_feedback)

{{ $review->review_feedback }}

@endif {{-- Reply --}} @if($reply)

{{ __('Your Reply') }}

{{ $reply->review_feedback }}

{{ $reply->created_at->toFormattedDateString() }}

@endif {{-- Footer: order link + action --}}
@endforeach
{{-- Pagination --}}
{{ $reviews->links() }}
@else

{{ __('No Reviews Yet') }}

{{ __('Reviews from clients will appear here once orders are completed.') }}

@endif @endsection