'use client';

/** JSON block — thin chat wrapper around `JsonTree`. */

import { LazyJsonTree } from '../../../../JsonTree/lazy';
import type { JsonBlock } from '../../../types/block';
import type { BlockRendererProps } from './types';

export default function JsonBlockRenderer({ block, ctx }: BlockRendererProps<JsonBlock>) {
  const mode = block.mode ?? (ctx.appearance === 'compact' ? 'compact' : 'full');
  return <LazyJsonTree data={block.data} mode={mode} />;
}
