<?php

namespace App\View\Components;

use App\Models\Agency;
use App\Repositries\AgencyRepository;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;

class AgenciesSelect extends Component
{
    public $agencies, $model, $agencyRepository;
    public function __construct(
        $model = null,
        AgencyRepository $agencyRepository
    ) {
        $this->model = $model;
        $this->agencyRepository = $agencyRepository;
        $this->agencies = $this->agencyRepository->index(new Agency());
    }

    /**
     * Get the view / contents that represent the component.
     */
    public function render(): View|Closure|string
    {
        return view('components.agencies-select');
    }
}
