Files
eatvio-infra/app/Livewire/Plan/Comment/Show.php
2024-01-09 13:25:22 +03:00

38 lines
888 B
PHP

<?php
namespace App\Livewire\Plan\Comment;
use App\Models\Plan;
use Livewire\Component;
use Illuminate\View\View;
class Show extends Component
{
public Plan $plan;
public array $tabpanelState = ['positive' => 'positive', 'negative' => false];
protected function getListeners(): array
{
return ['commentAdded' => '$refresh'];
}
public function render(): View
{
return view('livewire.plan.comment.show');
}
public function toggleTabpanelState(string $tabpanelName): void
{
collect($this->tabpanelState)->keys()->each(
function ($key) use ($tabpanelName) {
if ($key === $tabpanelName) {
$this->tabpanelState[$tabpanelName] = $tabpanelName;
} else {
$this->tabpanelState[$key] = false;
}
}
);
}
}