mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-26 14:11:07 +02:00
32 lines
665 B
PHP
32 lines
665 B
PHP
<?php
|
|
|
|
namespace App\Filament\Server\Components;
|
|
|
|
use Closure;
|
|
use Filament\Support\Concerns\EvaluatesClosures;
|
|
use Filament\Widgets\StatsOverviewWidget\Stat;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class SmallStatBlock extends Component
|
|
{
|
|
use EvaluatesClosures;
|
|
|
|
protected bool|Closure $copyOnClick = false;
|
|
|
|
public function copyOnClick(bool|Closure $copyOnClick = true): static
|
|
{
|
|
$this->copyOnClick = $copyOnClick;
|
|
|
|
protected string $value;
|
|
|
|
public function shouldCopyOnClick(): bool
|
|
{
|
|
return $this->evaluate($this->copyOnClick);
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return value($this->value);
|
|
}
|
|
}
|