← back to Norma
components/editor/HtmlSourceEditor.tsx
28 lines
/**
* HtmlSourceEditor — dynamic-import wrapper to prevent SSR errors.
*
* Usage:
* import HtmlSourceEditor from '@/components/editor/HtmlSourceEditor'
* <HtmlSourceEditor value={html} onChange={setHtml} />
*/
import dynamic from 'next/dynamic';
const HtmlSourceEditor = dynamic(() => import('./HtmlSourceEditorClient'), {
ssr: false,
loading: () => (
<div
className="cm-container"
style={{
minHeight: 300,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<span className="spinner" aria-label="Loading HTML editor" />
</div>
),
});
export default HtmlSourceEditor;