@extends('layouts.front.home') @section('title') {{ __('nav.ratings') }} - Vendor | Hema @endsection @section('css') @endsection @section('content') @php $isAr = app()->getLocale() === 'ar'; @endphp
@include('flash::message')

{{ __('nav.ratings') }}

{{ $isAr ? 'تابع انطباعات العملاء عن منتجاتك، راقب متوسط التقييمات، وراجع أكثر الملاحظات تأثيرًا في تجربة الشراء.' : 'Track customer feedback on your products, monitor rating averages, and review the comments that shape the buying experience.' }}

{{ $isAr ? 'متوسط التقييم' : 'Average Rating' }}

{{ number_format((float) $averageRating, 1) }}

{{ $isAr ? 'إجمالي التقييمات' : 'Total Ratings' }}

{{ number_format((int) $totalRatings) }}

{{ $isAr ? 'العناصر المقيمة' : 'Reviewed Items' }}

{{ number_format((int) ($reviewedItemsCount ?? 0)) }}

{{ $isAr ? 'تصفية المراجعات' : 'Filter Reviews' }}

{{ $isAr ? 'اعرض تقييمات منتج محدد أو درجة تقييم معينة.' : 'Focus on a specific product or score.' }}

{{ $isAr ? 'التقييم:' : 'Rating:' }}
{{ $isAr ? 'إعادة ضبط' : 'Reset' }}
{{ $isAr ? 'توزيع التقييمات' : 'Rating Breakdown' }}

{{ $isAr ? 'توزيع المراجعات حسب عدد النجوم.' : 'Distribution of reviews by star score.' }}

@for ($i = 5; $i >= 1; $i--) @php $percentage = $totalRatings > 0 ? ($ratingBreakdown[$i] / $totalRatings) * 100 : 0; @endphp
{{ $i }}
{{ $ratingBreakdown[$i] }}
@endfor
{{ $isAr ? 'مراجعات العملاء' : 'Customer Reviews' }}

{{ $isAr ? 'قائمة محدثة بتقييمات المنتجات وتعليقات العملاء.' : 'A fresh list of product ratings and customer comments.' }}

{{ number_format($ratings->total()) }} {{ $isAr ? 'مراجعة' : 'Reviews' }}
@forelse($ratings as $rating)
@php $reviewTitle = $rating->forable_type === \App\Models\User::class ? ($isAr ? 'تقييم الخدمة' : 'Service Review') : ($rating->forable?->name ?? ($isAr ? 'منتج' : 'Product')); @endphp {{ $reviewTitle }}

{{ $rating->user?->name ?? ($isAr ? 'مجهول' : 'Anonymous') }} • {{ $rating->created_at->diffForHumans() }}

@for ($i = 1; $i <= 5; $i++) @endfor {{ $rating->rating }}/5
@if(!empty($rating->comment))

"{{ $rating->comment }}"

@else

{{ $isAr ? 'لا توجد ملاحظات نصية لهذا التقييم.' : 'No written comment was left for this rating.' }}

@endif
@empty
{{ $isAr ? 'لا توجد تقييمات بعد' : 'No ratings yet' }}
@endforelse @if($ratings->hasPages())
{{ $ratings->withQueryString()->links('pagination::bootstrap-5') }}
@endif
@endsection