Co-authored-by: Jason Woltje <jason@diversecanvas.com> Co-committed-by: Jason Woltje <jason@diversecanvas.com>
30 lines
824 B
TypeScript
30 lines
824 B
TypeScript
"use client";
|
|
|
|
import React from "react";
|
|
import { KnowledgeEditor } from "./KnowledgeEditor";
|
|
|
|
interface EntryEditorProps {
|
|
content: string;
|
|
onChange: (content: string) => void;
|
|
}
|
|
|
|
/**
|
|
* EntryEditor - WYSIWYG editor for knowledge entries.
|
|
* Wraps KnowledgeEditor (Tiptap) with markdown round-trip.
|
|
* Content is stored as markdown; the editor provides rich text editing.
|
|
*/
|
|
export function EntryEditor({ content, onChange }: EntryEditorProps): React.JSX.Element {
|
|
return (
|
|
<div className="entry-editor">
|
|
<label className="block text-sm font-medium mb-2" style={{ color: "var(--text-2)" }}>
|
|
Content
|
|
</label>
|
|
<KnowledgeEditor
|
|
content={content}
|
|
onChange={onChange}
|
|
placeholder="Write your content here... Supports markdown formatting."
|
|
/>
|
|
</div>
|
|
);
|
|
}
|