generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@props([ | ||
'description' => null, | ||
'heading', | ||
'icon', | ||
]) | ||
|
||
<div {{ $attributes->class(['fi-ta-empty-state px-6 py-12']) }}> | ||
<div class="grid max-w-lg mx-auto text-center fi-ta-empty-state-content justify-items-center"> | ||
<div class="p-3 mb-4 bg-gray-100 rounded-full fi-ta-empty-state-icon-ctn dark:bg-gray-500/20"> | ||
<x-filament::icon :icon="$icon" | ||
class="w-6 h-6 text-gray-500 fi-ta-empty-state-icon dark:text-gray-400" /> | ||
</div> | ||
|
||
<h4 | ||
{{ $attributes->class(['fi-ta-empty-state-heading text-base font-semibold leading-6 text-gray-950 dark:text-white']) }}> | ||
{{ $heading }} | ||
</h4> | ||
|
||
@if ($description) | ||
<p {{ $attributes->class(['fi-ta-empty-state-description text-sm text-gray-500 dark:text-gray-400']) }}> | ||
{{ $description }} | ||
</p> | ||
@endif | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace JaOcero\ActivityTimeline\Concerns; | ||
|
||
use Closure; | ||
use Illuminate\Contracts\Support\Htmlable; | ||
use Illuminate\Contracts\View\View; | ||
|
||
trait HasEmptyState | ||
{ | ||
protected View | Htmlable | Closure | null $emptyState = null; | ||
|
||
protected string | Htmlable | Closure | null $emptyStateDescription = null; | ||
|
||
protected string | Htmlable | Closure | null $emptyStateHeading = null; | ||
|
||
protected string | Closure | null $emptyStateIcon = null; | ||
|
||
|
||
public function emptyStateDescription(string | Htmlable | Closure | null $description): static | ||
{ | ||
$this->emptyStateDescription = $description; | ||
|
||
return $this; | ||
} | ||
|
||
public function emptyStateHeading(string | Htmlable | Closure | null $heading): static | ||
{ | ||
$this->emptyStateHeading = $heading; | ||
|
||
return $this; | ||
} | ||
|
||
public function emptyStateIcon(string | Closure | null $icon): static | ||
{ | ||
$this->emptyStateIcon = $icon; | ||
|
||
return $this; | ||
} | ||
|
||
public function getEmptyStateDescription(): string | Htmlable | null | ||
{ | ||
return $this->evaluate($this->emptyStateDescription); | ||
} | ||
|
||
public function getEmptyStateHeading(): string | Htmlable | ||
{ | ||
return $this->evaluate($this->emptyStateHeading) ?? 'No ' . str($this->getName())->title(); | ||
} | ||
|
||
public function getEmptyStateIcon(): string | ||
{ | ||
return $this->evaluate($this->emptyStateIcon) ?? 'heroicon-o-x-mark'; | ||
} | ||
} |