mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-28 14:18:51 +01:00
* refactor: `ExecuteCode` component with submission state handling and cancellation message * fix: Remove unnecessary argument check for execute_code tool call * refactor: streamlined messages context * chore: remove unused Convo prop * chore: remove unnecessary whitespace in Message component * refactor: enhance message context with submission state and latest message tracking * chore: import order
16 lines
562 B
TypeScript
16 lines
562 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
type MessageContext = {
|
|
messageId: string;
|
|
nextType?: string;
|
|
partIndex?: number;
|
|
isExpanded: boolean;
|
|
conversationId?: string | null;
|
|
/** Submission state for cursor display - only true for latest message when submitting */
|
|
isSubmitting?: boolean;
|
|
/** Whether this is the latest message in the conversation */
|
|
isLatestMessage?: boolean;
|
|
};
|
|
|
|
export const MessageContext = createContext<MessageContext>({} as MessageContext);
|
|
export const useMessageContext = () => useContext(MessageContext);
|