'use client'; /** * Lazy-loaded PrettyCode Component * * Heavy Prism library (~500KB) is loaded only when component is rendered. * Use this for automatic code-splitting with Suspense fallback. * * For direct imports without lazy loading, use: * import PrettyCode from '@djangocfg/ui-tools/pretty-code' */ import { createLazyComponent } from '../../../../common'; import type { Language } from 'prism-react-renderer'; // ============================================================================ // Types // ============================================================================ export interface PrettyCodeProps { data: string | object; language: Language; className?: string; mode?: 'dark' | 'light'; inline?: boolean; customBg?: string; isCompact?: boolean; scrollIsolation?: boolean; maxLines?: number; /** Header expand (⤢) callback, shown while the code is height-capped. */ onExpand?: () => void; /** ``'card'`` (default) ships the full chrome. ``'plain'`` is * chrome-less — for embedding inside another scroll container. */ variant?: 'card' | 'plain'; } export type { Language }; // ============================================================================ // Code Loading Fallback // ============================================================================ function CodeLoadingFallback() { return (