import React from 'react'; import clsx from 'clsx'; import {Button} from '../../ui/buttons/button'; import {KeyboardArrowDownIcon} from '../../icons/material/KeyboardArrowDown'; import {Keyboard} from '../../ui/keyboard/keyboard'; import {MenubarButtonProps} from './menubar-button-props'; import { Menu, MenuItem, MenuTrigger, } from '../../ui/navigation/menu/menu-trigger'; import {Trans} from '../../i18n/trans'; type Level = 1 | 2 | 3 | 4; export function FormatMenuTrigger({editor, size}: MenubarButtonProps) { return ( { editor.commands.focus(); if (typeof key === 'string' && key.startsWith('h')) { editor.commands.toggleHeading({ level: parseInt(key.replace('h', '')) as Level, }); } else if (key === 'code') { editor.commands.toggleCode(); } else if (key === 'strike') { editor.commands.toggleStrike(); } else if (key === 'super') { editor.commands.toggleSuperscript(); } else if (key === 'sub') { editor.commands.toggleSubscript(); } else if (key === 'blockquote') { editor.commands.toggleBlockquote(); } else if (key === 'paragraph') { editor.commands.setParagraph(); } }} > Alt+1}> Alt+2}> Alt+3}> Alt+4}> E}> Shift+X} > . } > , } > Shift+B} > Alt+0} > ); }