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.

600 B
Raw Blame
import type { AgentSkillModalOptions } from '.';

const importAgentSkillModal = () => import('.');

let agentSkillModalPromise: ReturnType<typeof importAgentSkillModal> | undefined;

export const preloadAgentSkillModal = (): ReturnType<typeof importAgentSkillModal> =>
  (agentSkillModalPromise ??= importAgentSkillModal().catch((error) => {
    agentSkillModalPromise = undefined;
    throw error;
  }));

export const openAgentSkillModal = async (options: AgentSkillModalOptions) => {
  const { createAgentSkillModal } = await preloadAgentSkillModal();

  return createAgentSkillModal(options);
};