dc95587cca
* Embed markets using the "add markets" template * Override dev domain * Improve market modal style - contract searchbar now sticky - entire card clickable to select (if quickbet is hidden) - adjust selected card styles * remove extra export * Hide pills * Fix browser redirect warning * Insert all markets instead of just one * fix type error * fixup "Insert all markets instead of just one" Co-authored-by: Sinclair Chen <abc.sinclair@gmail.com>
14 lines
293 B
TypeScript
14 lines
293 B
TypeScript
import { Editor, Content } from '@tiptap/react'
|
|
|
|
export function insertContent(editor: Editor | null, ...contents: Content[]) {
|
|
if (!editor) {
|
|
return
|
|
}
|
|
|
|
let e = editor.chain()
|
|
for (const content of contents) {
|
|
e = e.createParagraphNear().insertContent(content)
|
|
}
|
|
e.run()
|
|
}
|