Skip to content

Open-source and local-first Slack and Notion alternative that puts you in control of your data

429 B
Raw Blame
import { Heading2 } from 'lucide-react';

import { EditorCommand } from '@colanode/client/types';

export const Heading2Command: EditorCommand = {
  key: 'heading2',
  name: 'Heading 2',
  description: 'Insert a heading 2 element',
  keywords: ['heading', 'heading2', 'h2'],
  icon: Heading2,
  disabled: false,
  handler: ({ editor, range }) => {
    editor.chain().focus().deleteRange(range).setNode('heading2').run();
  },
};