<?php

namespace App\Support\Badges\Domains;

use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeMapper;
use App\Support\Badges\BadgeSpec;

final class ManagedEnvironmentOnboardingVerificationStatusBadge implements BadgeMapper
{
    public function spec(mixed $value): BadgeSpec
    {
        $state = BadgeCatalog::normalizeManagedEnvironmentOnboardingVerificationStatus($value);

        return match ($state) {
            'not_started' => new BadgeSpec('Not started', 'gray', 'heroicon-m-minus-circle'),
            'in_progress' => new BadgeSpec('In progress', 'info', 'heroicon-m-arrow-path'),
            'needs_attention' => new BadgeSpec('Needs attention', 'warning', 'heroicon-m-exclamation-triangle'),
            'blocked' => new BadgeSpec('Blocked', 'danger', 'heroicon-m-x-circle'),
            'ready' => new BadgeSpec('Ready', 'success', 'heroicon-m-check-circle'),
            default => BadgeSpec::unknown(),
        };
    }
}
