<?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 GovernanceArtifactRetentionBadge implements BadgeMapper
{
    public function spec(mixed $value): BadgeSpec
    {
        return match (BadgeCatalog::normalizeState($value)) {
            'retained' => new BadgeSpec('Retained', 'info', 'heroicon-m-archive-box'),
            'hold' => new BadgeSpec('On hold', 'warning', 'heroicon-m-lock-closed'),
            'deletion_requested' => new BadgeSpec('Deletion requested', 'danger', 'heroicon-m-trash'),
            'expired_direct_access' => new BadgeSpec('Direct access expired', 'gray', 'heroicon-m-clock'),
            default => BadgeSpec::unknown(),
        };
    }
}