Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

465 B
Raw Blame
import { useChatStore } from '@/store/chat';

import { INSERT_ARTBOARD_REFERENCE_COMMAND } from './ReferArtboardPlugin';
import type { ArtboardReference } from './serialize';

export const insertArtboardReference = (reference: ArtboardReference) => {
  const editor = useChatStore.getState().mainInputEditor;
  if (!editor?.instance) return false;
  editor.instance.dispatchCommand(INSERT_ARTBOARD_REFERENCE_COMMAND, reference);
  editor.focus();
  return true;
};