| 1 | import { createContext, use } from "react"; |
| 2 | import type { ChatComposerHandle } from "./components/chat/ChatComposer"; |
| 3 | |
| 4 | export type ComposerHandleRef = React.RefObject<ChatComposerHandle | null>; |
| 5 | |
| 6 | export const ComposerHandleContext = createContext<ComposerHandleRef | null>(null); |
| 7 | |
| 8 | export function useComposerHandleContext(): ComposerHandleRef | null { |
| 9 | return use(ComposerHandleContext); |
| 10 | } |