defmodule JSONSchemaEditor.Viewer do @moduledoc """ A component for displaying JSON with syntax highlighting. It supports structural punctuation highlighting and indentation guides. ## Examples ### Passing a map 1, "b" => [true, nil]}} /> ### Passing a JSON string """ use Phoenix.Component alias JSONSchemaEditor.PrettyPrinter attr :json, :any, required: true, doc: "The JSON data to display (map, list, or already encoded string)" attr :class, :string, default: nil, doc: "Additional CSS classes for the container" attr :rest, :global, doc: "Additional HTML attributes" def render(assigns) do ~H"""
{PrettyPrinter.format(@json)}
""" end end