SmartCane/laravel_app/resources/views/livewire/components/badge.blade.php
2024-07-08 15:59:33 +02:00

15 lines
822 B
PHP

<span class="inline-flex items-center rounded-md {{ $this->getColorClasses() }} px-1.5 py-0.5 text-xs font-medium"
@if($this->type)
x-init="Echo.private(`{{$this->type}}.{{$this->id}}`).listen('Project{{ucfirst($this->type)}}Status', (e) => {
console.log(e);
if(e.project{{ucfirst($this->type)}}.status){
$wire.setStatus(e.project{{ucfirst($this->type)}}.status);
$wire.refreshPendingMessage();
}
});"
x-destroy="Echo.leaveChannel(`{{$this->type}}.{{$this->id}}`);"
@endif
>
{{ $status }}
</span>