<?php

namespace App\Support\Badges\Domains;

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

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

        return match ($state) {
            'blocking' => new BadgeSpec('Blocking', 'danger', 'heroicon-m-x-circle'),
            'warning' => new BadgeSpec('Warning', 'warning', 'heroicon-m-exclamation-triangle'),
            'safe' => new BadgeSpec('Safe', 'success', 'heroicon-m-check-circle'),
            default => BadgeSpec::unknown(),
        };
    }
}
