import {
  createPluginFactory,
  HotkeyPlugin,
  onKeyDownToggleElement,
} from '@udecode/plate-common';

export const ELEMENT_STATUS = 'status';

export const ELEMENT_STATUS_TIME = 'status_time';

export const createStatusPlugin = createPluginFactory<HotkeyPlugin>({
  key: ELEMENT_STATUS,
  isElement: true,
  isInline: true,
  isVoid: true,
  isMarkableVoid: true,
  handlers: {
    onKeyDown: onKeyDownToggleElement,
  },
  options: {
    hotkey: ['mod+opt+l', 'mod+shift+l'],
  },
});
