forked from eatvio/eatvio-infra
28 lines
700 B
PHP
28 lines
700 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Recipe\Comment;
|
|
|
|
use App\Models\Recipe;
|
|
use Livewire\Component;
|
|
|
|
class Show extends Component
|
|
{
|
|
public Recipe $recipe;
|
|
|
|
public array $tabpanelState = ['positive' => 'positive', 'negative' => false];
|
|
|
|
protected $listeners = ['commentAdded' => '$refresh'];
|
|
|
|
public function render()
|
|
{
|
|
return view('livewire.recipe.comment.show');
|
|
}
|
|
|
|
public function toggleTabpanelState($tabpanelName)
|
|
{
|
|
collect($this->tabpanelState)->keys()->map(fn ($key) => $key === $tabpanelName
|
|
? $this->tabpanelState[$tabpanelName] = $tabpanelName
|
|
: $this->tabpanelState[$key] = false, array_keys($this->tabpanelState));
|
|
}
|
|
}
|