
<?php $__env->startSection('title', 'نظرات من'); ?>

<?php $__env->startSection('content'); ?>

<div class="bread-crumb pt-3">
    <div class="container-fluid">
        <div class="content-box">
            <div class="container-fluid">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb mb-0">
                        <li class="breadcrumb-item"><a href="<?php echo e(route('home')); ?>" class="font-14 text-muted">خانه</a></li>
                        <li class="breadcrumb-item"><a href="<?php echo e(route('panel.index')); ?>" class="font-14 text-muted">پنل کاربری</a></li>
                        <li class="breadcrumb-item active main-color-one-color font-14" aria-current="page">نظرات من</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</div>

<div class="content">
    <div class="container-fluid">

        <div class="custom-filter d-lg-none d-block">
            <button class="btn btn-filter-float border-0 main-color-two-bg shadow-box px-4 rounded-3 position-fixed"
                style="z-index:999;bottom:80px;" type="button"
                data-bs-toggle="offcanvas" data-bs-target="#panelSideCanvas" aria-controls="panelSideCanvas">
                <i class="bi bi-list font-20 fw-bold text-white"></i>
                <span class="d-block font-14 text-white">منو</span>
            </button>
            <div class="offcanvas offcanvas-start" tabindex="-1" id="panelSideCanvas">
                <div class="offcanvas-header">
                    <h5 class="offcanvas-title">منو پنل</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
                </div>
                <div class="offcanvas-body">
                    <div class="panel-side">
                        <div class="content-box pb-0">
                            <div class="container-fluid">
                                <?php echo $__env->make('panel._sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="dashboard-panel">
            <div class="row gy-3">

                <div class="col-lg-3 d-lg-block d-none">
                    <div class="panel-side">
                        <div class="content-box pb-0">
                            <div class="container-fluid">
                                <?php echo $__env->make('panel._sidebar', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-lg-9">
                    <div class="content-box">
                        <div class="container-fluid">
                            <div class="title-panel mb-3">
                                <h6 class="font-16">نظرات من</h6>
                            </div>

                            <?php if($reviews->isEmpty()): ?>
                            <p class="text-muted font-14 text-center py-4">هنوز نظری برای هیچ محصولی ثبت نکرده‌اید.</p>
                            <?php else: ?>
                            <div class="d-grid gap-3">
                                <?php $__currentLoopData = $reviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php
                                    $statusMap = [
                                        'approved' => ['تأیید شده',       'success'],
                                        'pending'  => ['در انتظار تأیید', 'warning'],
                                        'rejected' => ['رد شده',          'danger'],
                                    ];
                                    [$statusLabel, $statusColor] = $statusMap[$review->status] ?? [$review->status, 'secondary'];
                                    $rating = (int) $review->rating;
                                ?>
                                <div class="border rounded-3 p-3">
                                    <div class="d-flex justify-content-between align-items-start flex-wrap gap-2 mb-2">
                                        <div>
                                            <?php if($review->product): ?>
                                            <a href="<?php echo e(route('product.show', $review->product->slug)); ?>"
                                               class="fw-bold font-14 main-color-one-color text-decoration-none">
                                                <?php echo e($review->product->title); ?>

                                            </a>
                                            <?php else: ?>
                                            <span class="fw-bold font-14 text-muted">محصول حذف شده</span>
                                            <?php endif; ?>
                                            <div class="mt-1">
                                                <?php for($s = 1; $s <= 5; $s++): ?>
                                                    <i class="bi bi-star-fill font-12 <?php echo e($s <= $rating ? 'text-warning' : 'text-muted opacity-50'); ?>"></i>
                                                <?php endfor; ?>
                                                <span class="text-muted font-12 me-1">(<?php echo e($rating); ?> از ۵)</span>
                                            </div>
                                        </div>
                                        <span class="badge rounded-pill bg-<?php echo e($statusColor); ?>"><?php echo e($statusLabel); ?></span>
                                    </div>

                                    <?php if($review->body): ?>
                                    <p class="font-13 text-muted mb-2"><?php echo e($review->body); ?></p>
                                    <?php endif; ?>

                                    <?php if(!empty($review->pros)): ?>
                                    <div class="font-12 mb-1">
                                        <span class="text-success"><i class="bi bi-plus-circle"></i> نقاط مثبت:</span>
                                        <?php echo e(implode('، ', (array) $review->pros)); ?>

                                    </div>
                                    <?php endif; ?>

                                    <?php if(!empty($review->cons)): ?>
                                    <div class="font-12 mb-1">
                                        <span class="text-danger"><i class="bi bi-dash-circle"></i> نقاط منفی:</span>
                                        <?php echo e(implode('، ', (array) $review->cons)); ?>

                                    </div>
                                    <?php endif; ?>

                                    <div class="text-muted font-12 mt-2">
                                        <i class="bi bi-clock"></i> <?php echo e($review->created_at?->format('Y-m-d H:i')); ?>

                                    </div>
                                </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </div>
                            <?php if($reviews->hasPages()): ?>
                            <div class="d-flex justify-content-center mt-3">
                                <?php echo e($reviews->links()); ?>

                            </div>
                            <?php endif; ?>
                            <?php endif; ?>
                        </div>
                    </div>
                </div>

            </div>
        </div>

    </div>
</div>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('site.layouts.site-layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/louishop/public_html/engine/resources/views/panel/comments/index.blade.php ENDPATH**/ ?>