import * as React from 'react'; import { ICommand, TextState, TextApi } from './'; export const title4: ICommand = { name: 'title4', keyCommand: 'title4', shortcuts: 'ctrlcmd+4', buttonProps: { 'aria-label': 'Insert title4', title: 'Insert title 4' }, icon:
Title 4
, execute: (state: TextState, api: TextApi) => { let modifyText = `#### ${state.selectedText}\n`; if (!state.selectedText) { modifyText = `#### `; } api.replaceSelection(modifyText); }, };