sourcebot/packages/web/src/features/chat/customSlateEditor.tsx
Brendan Kellam 2b0dac4782
feat: Ask Sourcebot (#392)
Co-authored-by: msukkari <michael.sukkarieh@mail.mcgill.ca>
2025-07-23 11:25:15 -07:00

27 lines
No EOL
583 B
TypeScript

'use client';
import { Slate } from "slate-react";
import { useCustomSlateEditor } from "./useCustomSlateEditor";
import { CustomElement } from "./types";
interface CustomSlateEditorProps {
children: React.ReactNode;
}
const initialValue: CustomElement[] = [
{
type: 'paragraph',
children: [{ text: '' }],
},
];
export const CustomSlateEditor = ({ children }: CustomSlateEditorProps) => {
const editor = useCustomSlateEditor();
return <Slate
editor={editor}
initialValue={initialValue}
>
{children}
</Slate>;
}