11 lines
391 B
TypeScript
11 lines
391 B
TypeScript
import { createContext, use } from "react";
|
|
import type { ChatComposerHandle } from "./components/chat/ChatComposer";
|
|
|
|
export type ComposerHandleRef = React.RefObject<ChatComposerHandle | null>;
|
|
|
|
export const ComposerHandleContext = createContext<ComposerHandleRef | null>(null);
|
|
|
|
export function useComposerHandleContext(): ComposerHandleRef | null {
|
|
return use(ComposerHandleContext);
|
|
}
|