<?php

namespace App\Livewire\Blesser\Comment;

use App\Enums\CommentStatusEnum;
use Livewire\Component;

class CommentList extends Component
{

    public $product;

    public $comments;

    public function mount()
    {
        $this->comments = $this->product->comments()->where('status', CommentStatusEnum::Approved)->latest()->get();
    }

    public function render()
    {
        return view('livewire.blesser.comment.comment-list');
    }
}
