mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-30 20:44:44 +02:00
45 lines
805 B
PHP
45 lines
805 B
PHP
<?php
|
|
|
|
namespace App\Filament\Server\Components;
|
|
|
|
use Filament\Widgets\StatsOverviewWidget\Stat;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
|
|
class StatBlock extends Stat
|
|
{
|
|
protected string|\Closure|Htmlable|null $label;
|
|
|
|
protected string $view = 'filament.components.server-data-block';
|
|
|
|
protected $value;
|
|
|
|
public function label(string $label): static
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function value($value): static
|
|
{
|
|
$this->value = $value;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function getValue(): mixed
|
|
{
|
|
return value($this->value);
|
|
}
|
|
|
|
public function toHtml(): string
|
|
{
|
|
return $this->render()->render();
|
|
}
|
|
}
|