260703_01_FST: First Commit
This commit is contained in:
24
registry/components/kri-editor/KriEditor.tsx
Normal file
24
registry/components/kri-editor/KriEditor.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
"use client";
|
||||
|
||||
import type { KriEditorProps, KriEditorMode } from "./types";
|
||||
import { KriEditorHtmlOnly } from "./KriEditorHtmlOnly";
|
||||
import { KriEditorWysiwyg } from "./KriEditorWysiwyg";
|
||||
import {KriEditorSms} from "./KriEditorSms";
|
||||
|
||||
function resolveMode(mode?: KriEditorMode): KriEditorMode {
|
||||
return mode ?? "wysiwyg";
|
||||
}
|
||||
|
||||
export function KriEditor(props: KriEditorProps) {
|
||||
const mode = resolveMode(props.mode);
|
||||
|
||||
if (mode === "html") {
|
||||
return <KriEditorHtmlOnly {...props} mode={mode} />;
|
||||
}
|
||||
|
||||
if(mode === "sms") {
|
||||
return <KriEditorSms {...props} mode={mode} />
|
||||
}
|
||||
|
||||
return <KriEditorWysiwyg {...props} mode={mode} />;
|
||||
}
|
||||
Reference in New Issue
Block a user