type = $type; $this->id ??= $id; $this->status = Status::tryFrom($status) ?? Status::Success; } public function getColorClasses(): string { return match ($this->status) { Status::Success => 'bg-green-100 text-green-700', Status::Failed => 'bg-red-100 text-red-700', Status::Pending => 'bg-gray-100 text-gray-600', }; } public function setStatus(string $status): void { $this->status = Status::tryFrom($status) ?? Status::Success; } public function refreshPendingMessage() { $this->dispatch('PendingMessage:refresh'); } public function render() { logger(sprintf('%s %s', __CLASS__, $this->id)); return view('livewire.components.badge'); } }