import type { Editor } from "@tiptap/react"; import { BubbleMenu } from "@tiptap/react/menus"; import Row from "@moduletrace/twui/layout/Row"; import ComposerFormatButton from "./composer-format-button"; import { ComposerFormats } from "../(data)/composer-formats"; type Props = { editor: Editor; }; /** * Formatting for the selected text, floating over it: bold, italic, * strike, code, link, quote and lists. The same marks have their usual * shortcuts (Mod+B, Mod+I, ...) and markdown typing (`**`, `- `, `> `). */ export default function ComposerFormatBubble({ editor }: Props) { return ( from != to && !editor.isActive("codeBlock") && !editor.isActive("mention") } > {ComposerFormats.map((format) => ( format.toggle({ editor })} > ))} ); }