Skip to content

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

434 B
Raw Blame
import { SeparatorHorizontal } from 'lucide-react';

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

export const DividerCommand: EditorCommand = {
  key: 'divider',
  name: 'Divider',
  description: 'Insert a divider',
  keywords: ['divider', 'break', 'hr'],
  icon: SeparatorHorizontal,
  disabled: false,
  handler: ({ editor, range }) => {
    editor.chain().focus().deleteRange(range).setHorizontalRule().run();
  },
};