2025-06-23 07:10:27 -04:00

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);
}
}