<?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 GovernanceArtifactLifecycleBadge implements BadgeMapper
{
    public function spec(mixed $value): BadgeSpec
    {
        return match (BadgeCatalog::normalizeState($value)) {
            'current' => new BadgeSpec('Current', 'success', 'heroicon-m-check-circle'),
            'historical' => new BadgeSpec('Historical', 'gray', 'heroicon-m-archive-box'),
            'superseded' => new BadgeSpec('Superseded', 'warning', 'heroicon-m-arrow-path'),
            default => BadgeSpec::unknown(),
        };
    }
}