Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

964 B
Raw Blame
import { t } from '@app/lib/i18n';
import { TOKENS } from '@core/hotkey/tokens';
import PhoneIcon from '@icon/system/regular/phone.svg';
import type { CreatableBlock } from './types';

/** Bind the call action to the host router without creating a meeting. */
export function createCallCommand(actions: {
  navigate: (path: string) => void;
  close: () => void;
  enabled: () => boolean;
}): CreatableBlock {
  return {
    id: 'Call',
    get label() {
      return t('create.callLabel');
    },
    icon: PhoneIcon,
    description: () => t('create.callDescription'),
    keywords: ['new', 'create', 'meeting', 'video', 'call'],
    blockName: 'call',
    hotkeyToken: TOKENS.create.call,
    hotkey: 'c',
    enabled: actions.enabled,
    registrationType: 'add',
    runWithInputFocused: false,
    keyDownHandler: () => {
      if (!actions.enabled()) return false;
      actions.close();
      actions.navigate('/meet/new');
      return true;
    },
  };
}