'use client';

/**
 * `@djangocfg/ui-tools/json-tree` subpath entrypoint.
 *
 * Single lazy-loaded export (`LazyJsonTree`) wrapping the renderer
 * (~80KB chunk including the toolbar UI). Suspense fallback ships from
 * the shared `LoadingFallback`.
 */

import { createLazyComponent, LoadingFallback } from '../../../common/lazy-wrapper';
import type { JsonTreeProps } from './types';

export type { JsonTreeProps, JsonValue, JsonAction, JsonSize } from './types';

export const LazyJsonTree = createLazyComponent<JsonTreeProps>(
  () => import('./JsonViewer').then((m) => ({ default: m.JsonTree })),
  {
    displayName: 'LazyJsonTree',
    fallback: <LoadingFallback minHeight={100} text="Loading JSON viewer…" />,
  },
);
