Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Components/Concerns/HasIcon.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@

namespace CodeWithDennis\SimpleAlert\Components\Concerns;

use BackedEnum;
use Closure;
use CodeWithDennis\SimpleAlert\Components\Enums\IconAnimation;
use Illuminate\Contracts\Support\Htmlable;

trait HasIcon
{
protected string|Htmlable|Closure|null $icon = null;
protected string|BackedEnum|Htmlable|Closure|null $icon = null;

protected Closure|IconAnimation|null $iconAnimation = null;

public function icon(string|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static
public function icon(string|BackedEnum|Htmlable|Closure|null $icon, Closure|IconAnimation|null $animation = null): static
{
$this->icon = $icon;
$this->iconAnimation = $animation;
Expand All @@ -25,7 +26,7 @@ public function getIconAnimation(): ?string
return $this->evaluate($this->iconAnimation)?->value ?? null;
}

public function getIcon(): ?string
public function getIcon(): BackedEnum|string|null
{
return $this->evaluate($this->icon);
}
Expand Down