Files
pterodactyl-panel/resources/scripts/components/elements/LazyCodemirrorEditor.tsx
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

24 lines
813 B
TypeScript

import React, { Suspense } from 'react';
import Spinner from '@/components/elements/Spinner';
import type { CodemirrorEditorHandle, Props as CodemirrorEditorProps } from '@/components/elements/CodemirrorEditor';
import { editorContainerClass } from '@/components/elements/codemirror/layout';
import { cn } from '@/lib/cn';
export type { CodemirrorEditorHandle };
const CodemirrorEditor = React.lazy(() => import('@/components/elements/CodemirrorEditor'));
const LazyCodemirrorEditor = (props: CodemirrorEditorProps) => (
<Suspense
fallback={
<div className={cn(editorContainerClass, props.className)}>
<Spinner centered size={'large'} />
</div>
}
>
<CodemirrorEditor {...props} />
</Suspense>
);
export default LazyCodemirrorEditor;