<?php

namespace Modules\Main\Http\Livewire;

use Livewire\Component;
use Modules\Main\Models\Agent\Agent;
use Modules\Main\Models\Company\Company;
use Modules\Main\Models\Company\CompanyAdmin;

class CreateAgentLivewire extends Component
{
    public $availableCompanies;
    public $companyId;
    public $containerId;
    public function mount($containerId = 'createAgentModal')
    {
        $this->containerId = $containerId;
        $availableCompaniesIds = GetAvailableCompanies('Collection')->pluck('id');
       
        $this->availableCompanies = Company::whereIn('id', $availableCompaniesIds)->get();
        if ($this->availableCompanies->count() == 1) {
            $this->companyId = $this->availableCompanies->first()->id;
        };
    }

    public function render()
    {
        return view('main::agent.livewire.create', [
        ]);
    }


}