TenantAtlas/app/Filament/Widgets/Tenant/FindingExceptionStatsOverview.php
2026-03-27 16:41:39 +01:00

40 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Filament\Widgets\Tenant;
use App\Filament\Resources\FindingExceptionResource;
use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
class FindingExceptionStatsOverview extends BaseWidget
{
protected static bool $isLazy = false;
protected ?string $pollingInterval = null;
/**
* @return array<int, Stat>
*/
protected function getStats(): array
{
$counts = FindingExceptionResource::exceptionStatsForCurrentTenant();
return [
Stat::make('Active', $counts['active'])
->icon('heroicon-o-check-badge')
->color('success'),
Stat::make('Expiring', $counts['expiring'])
->icon('heroicon-o-exclamation-triangle')
->color('warning'),
Stat::make('Expired', $counts['expired'])
->icon('heroicon-o-x-circle')
->color('danger'),
Stat::make('Pending approval', $counts['pending'])
->icon('heroicon-o-clock')
->color('gray'),
];
}
}