import { useState, useRef, FunctionComponent } from 'react'; import { SkipToContent } from '@patternfly/react-core'; import ChatbotToggle from '@patternfly/chatbot/dist/dynamic/ChatbotToggle'; import Chatbot, { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot'; export const ChatbotDemo: FunctionComponent = () => { const [chatbotVisible, setChatbotVisible] = useState(true); const toggleRef = useRef(null); const chatbotRef = useRef(null); const displayMode = ChatbotDisplayMode.default; const handleSkipToContent = (e) => { e.preventDefault(); if (!chatbotVisible && toggleRef.current) { toggleRef.current.focus(); } if (chatbotVisible && chatbotRef.current) { chatbotRef.current.focus(); } }; return ( <> Skip to chatbot setChatbotVisible(!chatbotVisible)} id="chatbot-toggle" ref={toggleRef} />   ); };