forked from eatvio/eatvio-infra
38 lines
888 B
PHP
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;
|
|
}
|
|
}
|
|
);
|
|
}
|
|
}
|