47 lines
1.4 KiB
PHP
47 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Inventory;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
|
|
class InventoryKpiBadges
|
|
{
|
|
public static function coverage(int $restorableCount, int $partialCount): string
|
|
{
|
|
return Blade::render(<<<'BLADE'
|
|
<div class="flex items-center gap-2">
|
|
<x-filament::badge color="success" size="sm">
|
|
Restorable {{ $restorableCount }}
|
|
</x-filament::badge>
|
|
|
|
<x-filament::badge color="warning" size="sm">
|
|
Partial {{ $partialCount }}
|
|
</x-filament::badge>
|
|
</div>
|
|
BLADE, [
|
|
'restorableCount' => $restorableCount,
|
|
'partialCount' => $partialCount,
|
|
]);
|
|
}
|
|
|
|
public static function inventoryOps(int $dependenciesCount, int $riskCount): string
|
|
{
|
|
return Blade::render(<<<'BLADE'
|
|
<div class="flex items-center gap-2">
|
|
<x-filament::badge color="gray" size="sm">
|
|
Dependencies {{ $dependenciesCount }}
|
|
</x-filament::badge>
|
|
|
|
<x-filament::badge color="danger" size="sm">
|
|
Risk {{ $riskCount }}
|
|
</x-filament::badge>
|
|
</div>
|
|
BLADE, [
|
|
'dependenciesCount' => $dependenciesCount,
|
|
'riskCount' => $riskCount,
|
|
]);
|
|
}
|
|
}
|