import type { JSX } from 'solid-js'; import { createMemo, For } from 'solid-js'; import type { JsonTokenKind } from '@/lib/jsonTokens'; import { tokeniseJson } from '@/lib/jsonTokens'; interface Props { /** JSON text, shown as it is: pretty-print it first. */ json: string; } const TOKEN_CLASS: Record = { key: 'text-code-key', string: 'text-code-string', number: 'text-code-number', literal: 'text-code-literal', plain: '', }; /** * JSON text, syntax highlighted. Each token is a text span, never HTML, as * releases come from outside sources. */ export function JsonView(props: Props): JSX.Element { const tokens = createMemo(() => tokeniseJson(props.json)); return (
      
        
          {(token) => {token.text}}
        
      
    
); }