import { useCallback } from "react"; import { useOperoChatContext } from "../components/OperoChatContext"; /** * Hook that provides a function to open the Opero chat. * Can be used with any onPress, onFocus, or other event handlers. * * @returns Function that opens the chat when called * * @example * ```tsx * const openChat = useOperoChatTrigger(); * * return ( * * Ask AI Assistant * * ); * ``` */ export const useOperoChatTrigger = () => { const { openChat } = useOperoChatContext(); return useCallback(() => { openChat(); }, [openChat]); };