TenantAtlas/apps/platform/app/Support/Badges/Domains/CoverageV2CoverageLevelBadge.php
ahmido 4aaec3521a feat: add coverage v2 operator surface (#485)
Automated PR provided by Codex via Gitea API.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #485
2026-06-26 12:50:36 +00:00

28 lines
1019 B
PHP

<?php
declare(strict_types=1);
namespace App\Support\Badges\Domains;
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeMapper;
use App\Support\Badges\BadgeSpec;
final class CoverageV2CoverageLevelBadge implements BadgeMapper
{
public function spec(mixed $value): BadgeSpec
{
$state = BadgeCatalog::normalizeState($value);
return match ($state) {
'detected' => new BadgeSpec('Detected', 'gray', 'heroicon-m-eye'),
'content_backed' => new BadgeSpec('Content backed', 'info', 'heroicon-m-document-check'),
'comparable' => new BadgeSpec('Comparable', 'info', 'heroicon-m-arrows-right-left'),
'renderable' => new BadgeSpec('Renderable', 'primary', 'heroicon-m-document-text'),
'restorable' => new BadgeSpec('Restorable', 'success', 'heroicon-m-arrow-uturn-left'),
'certified' => new BadgeSpec('Certified', 'success', 'heroicon-m-check-badge'),
default => BadgeSpec::unknown(),
};
}
}