<?php

namespace App\View\Components\Grocery;

use App\Repositories\Catalog\CategoryRepository;
use App\Repositories\Catalog\GenderRepository;
use App\Repositories\Catalog\BrandRepository;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class HeaderGenderDropdown extends Component
{

    protected $categories = [];
    protected $genders = [];
    protected $brands = [];
    /**
     * Create a new component instance.
     */
    public function __construct(CategoryRepository $categoryRepository, GenderRepository $genderRepository, BrandRepository $brandRepository)
    {
        $this->categories = $categoryRepository->getList([]);
        $this->genders = $genderRepository->getList([]);    
        $this->brands = $brandRepository->getList([]);    
    }

    /**
     * Get the view / contents that represent the component.
     */
    public function render(): View|Closure|string
    {

        return view('components.grocery.header-gender-dropdown', [
            'categories' => $this->categories,
            'genders' => $this->genders,
            'brands'    => $this->brands,
            ]);
    }
}
