mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add info callout custom extension
This commit is contained in:
parent
e6ebd195d7
commit
fe8fdd1769
10 changed files with 163 additions and 59 deletions
32
front/components/Canva/Canva.tsx
Normal file
32
front/components/Canva/Canva.tsx
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import React from "react";
|
||||
import { useEditor, EditorContent } from "@tiptap/react";
|
||||
import StarterKit from "@tiptap/starter-kit";
|
||||
// Custom Extensions
|
||||
import InfoCallout from "../Editor/Extensions/Callout/Info/InfoCallout";
|
||||
|
||||
interface Editor {
|
||||
content: string;
|
||||
element: any;
|
||||
//course: any;
|
||||
}
|
||||
|
||||
function Canva(props: Editor) {
|
||||
const isEditable = false;
|
||||
const editor: any = useEditor({
|
||||
editable: isEditable,
|
||||
extensions: [
|
||||
StarterKit,
|
||||
|
||||
// Custom Extensions
|
||||
InfoCallout.configure({
|
||||
editable: isEditable,
|
||||
}),
|
||||
],
|
||||
|
||||
content: props.content,
|
||||
});
|
||||
|
||||
return <EditorContent editor={editor} />;
|
||||
}
|
||||
|
||||
export default Canva;
|
||||
Loading…
Add table
Add a link
Reference in a new issue