Files
dify/web/app/components/base/chat/chat/context.ts
T
Stephen Zhouandautofix-ci[bot] a84c2d36a3 style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

32 lines
638 B
TypeScript

'use client'
import type { ChatProps } from './index'
import { createContext, useContext } from 'use-context-selector'
export type ChatContextValue = Pick<
ChatProps,
| 'config'
| 'isResponding'
| 'chatList'
| 'showPromptLog'
| 'questionIcon'
| 'answerIcon'
| 'onSend'
| 'onRegenerate'
| 'onAnnotationEdited'
| 'onAnnotationAdded'
| 'onAnnotationRemoved'
| 'disableFeedback'
| 'onFeedback'
| 'getHumanInputNodeData'
> & {
readonly?: boolean
}
export const ChatContext = createContext<ChatContextValue>({
chatList: [],
readonly: false,
})
export const useChatContext = () => useContext(ChatContext)