<?php

namespace App\Support\Badges\Domains;

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

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

        return match ($state) {
            'enabled' => new BadgeSpec('Enabled', 'success', 'heroicon-m-check-circle'),
            'preview_only' => new BadgeSpec('Preview only', 'warning', 'heroicon-m-exclamation-triangle'),
            default => BadgeSpec::unknown(),
        };
    }
}
