<?php

namespace App\View\Components\Shop;

use App\Repositories\Catalog\ProductRepository;
use Illuminate\View\Component;
use Illuminate\View\View;
use Illuminate\Support\Collection;

class ViewedProducts extends Component
{
    public $except_ids = [];

    public Collection $viewedProducts;

    /**
     * Create a new component instance.
     */
    public function __construct($except_ids = [])
    {
        $productRepository = new ProductRepository();

        $this->viewedProducts = $productRepository->viewed_products($except_ids);

    }

    /**
     * Get the view/contents that represent the component.
     */
    public function render(): View
    {
        return view('components.shop.viewed-products');
    }
}
