import { Menu } from "@mantine/core"; import { BlockNoteEditor, BlockSchema } from "bocknoat-core"; import { useCallback } from "react"; import { ColorIcon } from "../../../SharedComponents/ColorPicker/components/ColorIcon"; import { ColorPicker } from "../../../SharedComponents/ColorPicker/components/ColorPicker"; import { ToolbarButton } from "../../../SharedComponents/Toolbar/components/ToolbarButton"; export const ColorStyleButton = (props: { editor: BlockNoteEditor; }) => { const setTextColor = useCallback( (color: string) => { props.editor.focus(); color === "default" ? props.editor.removeStyles({ textColor: color }) : props.editor.addStyles({ textColor: color }); }, [props.editor] ); const setBackgroundColor = useCallback( (color: string) => { props.editor.focus(); color === "default" ? props.editor.removeStyles({ backgroundColor: color }) : props.editor.addStyles({ backgroundColor: color }); }, [props.editor] ); return ( ( )} /> ); };