'use client' import type { ReactNode } from 'react' import { createContext, useContext } from 'use-context-selector' import type { ChatProps } from './index' export type ChatContextValue = Pick const ChatContext = createContext({ chatList: [], }) type ChatContextProviderProps = { children: ReactNode } & ChatContextValue export const ChatContextProvider = ({ children, config, isResponding, chatList, showPromptLog, questionIcon, answerIcon, onSend, onRegenerate, onAnnotationEdited, onAnnotationAdded, onAnnotationRemoved, onFeedback, }: ChatContextProviderProps) => { return ( {children} ) } export const useChatContext = () => useContext(ChatContext) export default ChatContext