import type { Editor } from '@tiptap/core' import { clsx } from 'clsx' import { createSignal, Show, For } from 'solid-js' import { useLocalize } from '../../../context/localize' import { Icon } from '../../_shared/Icon' import styles from './BubbleMenu.module.scss' type Props = { editor: Editor ref: (el: HTMLElement) => void } const backgrounds = [null, 'white', 'black', 'yellow', 'pink', 'green'] export const IncutBubbleMenu = (props: Props) => { const { t } = useLocalize() const [substratBubbleOpen, setSubstratBubbleOpen] = createSignal(false) const handleChangeBg = (bg) => { props.editor.chain().focus().setArticleBg(bg).run() setSubstratBubbleOpen(false) } return (
{(bg) =>
handleChangeBg(bg)} class={clsx(styles.color, styles[bg])} />}
) }