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.

617 B
Raw Blame
'use client';

import isEqual from 'fast-deep-equal';

import { dataSelectors, messageStateSelectors, useConversationStore } from '../../store';
import { useChatMarkdown } from '../useChatMarkdown';

export const useMarkdown = (id: string, disableStreaming = false, content?: string) => {
  const item = useConversationStore(dataSelectors.getDbMessageById(id), isEqual)!;
  const isGenerating = useConversationStore(messageStateSelectors.isMessageGenerating(id));

  return useChatMarkdown({
    citations: item?.search?.citations,
    enableStream: !disableStreaming,
    content,
    id,
    isGenerating,
  });
};