Charles 1900c04b71
Filament v4 🎉 (#1651)
Co-authored-by: RMartinOscar <40749467+RMartinOscar@users.noreply.github.com>
Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
Co-authored-by: Lance Pioch <git@lance.sh>
2025-09-08 13:12:33 -04:00

30 lines
680 B
PHP

<?php
namespace App\Filament\Server\Components;
use Closure;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Illuminate\Contracts\View\View;
class SmallStatBlock extends Stat
{
protected bool|Closure $copyOnClick = false;
public function copyOnClick(bool|Closure $copyOnClick = true): static
{
$this->copyOnClick = $copyOnClick;
return $this;
}
public function shouldCopyOnClick(): bool
{
return $this->evaluate($this->copyOnClick);
}
public function render(): View
{
return view('filament.components.server-small-data-block', array_merge($this->getViewData(), $this->extractPublicMethods()));
}
}