buster/web/src/controllers/ReasoningController/ReasoningMessages/ReasoningMessage_PillContai.../ReasoningMessage_PillsConta...

29 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-03-04 14:55:19 +08:00
import React from 'react';
2025-03-05 10:23:38 +08:00
import type { BusterChatMessageReasoning_pills } from '@/api/asset_interfaces';
import type { ReasoningMessageProps } from '../ReasoningMessageSelector';
2025-03-14 02:11:22 +08:00
import { useGetChatMessage } from '@/api/buster_rest/chats';
2025-03-06 04:14:24 +08:00
import { ReasoningMessagePillsContainer } from './ReasoningMessagePillsContainer';
2025-03-04 14:55:19 +08:00
export const ReasoningMessage_PillsContainer: React.FC<ReasoningMessageProps> = React.memo(
({ reasoningMessageId, messageId, isCompletedStream, chatId }) => {
2025-03-14 02:11:22 +08:00
const reasoningMessage = useGetChatMessage(
2025-03-06 04:14:24 +08:00
messageId,
(x) => x?.reasoning_messages[reasoningMessageId]
)!;
2025-03-04 14:55:19 +08:00
2025-03-06 04:14:24 +08:00
const reasoningMessagePills = reasoningMessage as BusterChatMessageReasoning_pills;
const { status } = reasoningMessagePills;
2025-03-04 14:55:19 +08:00
return (
2025-03-06 04:14:24 +08:00
<ReasoningMessagePillsContainer
{...reasoningMessagePills}
status={status}
2025-03-04 14:55:19 +08:00
isCompletedStream={isCompletedStream}
chatId={chatId}
2025-03-06 04:14:24 +08:00
/>
2025-03-04 14:55:19 +08:00
);
}
);
ReasoningMessage_PillsContainer.displayName = 'ReasoningMessage_PillsContainer';