forked from eatvio/eatvio-infra
32 lines
689 B
PHP
32 lines
689 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Chat;
|
|
|
|
use Illuminate\Contracts\View\Factory as ViewFactory;
|
|
use Illuminate\Contracts\View\View;
|
|
use Illuminate\Support\Collection;
|
|
use Livewire\Component;
|
|
|
|
class LastUsers extends Component
|
|
{
|
|
public Collection $lastChatUsers;
|
|
|
|
public ?int $activeUserId = null;
|
|
|
|
public int $curUserId;
|
|
|
|
public string $chanId;
|
|
|
|
public function render(): View|ViewFactory
|
|
{
|
|
return view('livewire.chat.last-users');
|
|
}
|
|
|
|
public function switchTo(int $id): void
|
|
{
|
|
$this->activeUserId = $id;
|
|
$this->dispatch('updateRecipientId', id: $id)->to('chat.message-window');
|
|
$this->redirectRoute('chat.show', $id);
|
|
}
|
|
}
|