import { FunctionComponent, MouseEvent, useState } from 'react'; import { Brand, Bullseye, Checkbox, DropdownGroup, DropdownItem, DropdownList, FormGroup, Stack, Title } from '@patternfly/react-core'; import { ChatbotHeader, ChatbotHeaderMain, ChatbotHeaderMenu, ChatbotHeaderActions, ChatbotHeaderTitle, ChatbotHeaderOptionsDropdown, ChatbotHeaderSelectorDropdown, ChatbotHeaderNewChatButton } from '@patternfly/chatbot/dist/dynamic/ChatbotHeader'; import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot'; import OutlinedWindowRestoreIcon from '@patternfly/react-icons/dist/esm/icons/outlined-window-restore-icon'; import ExpandIcon from '@patternfly/react-icons/dist/esm/icons/expand-icon'; import OpenDrawerRightIcon from '@patternfly/react-icons/dist/esm/icons/open-drawer-right-icon'; import PFHorizontalLogoColor from './PF-HorizontalLogo-Color.svg'; import PFHorizontalLogoReverse from './PF-HorizontalLogo-Reverse.svg'; export const BasicDemo: FunctionComponent = () => { const [selectedModel, setSelectedModel] = useState('Granite Code 7B'); const [showAll, setShowAll] = useState(true); const [showMenu, setShowMenu] = useState(true); const [showNewChatButton, setShowNewChatButton] = useState(true); const [showLogo, setShowLogo] = useState(false); const [showCenteredLogo, setShowCenteredLogo] = useState(true); const [showSelectorDropdown, setShowSelectorDropdown] = useState(true); const [showOptionsDropdown, setShowOptionsDropdown] = useState(true); const onSelectModel = (_event: MouseEvent | undefined, value: string | number | undefined) => { setSelectedModel(value as string); }; const title = ( <>
ChatBot Extension ); return ( { setShowMenu(true); setShowNewChatButton(true); setShowCenteredLogo(true); setShowSelectorDropdown(true); setShowOptionsDropdown(true); showLogo && setShowLogo(false); }} name="basic-inline-radio" label="All" id="all" /> { setShowMenu(!showMenu); showAll && setShowAll(!showAll); }} name="basic-inline-radio" label="With menu" id="menu" /> { setShowNewChatButton(!showNewChatButton); showAll && setShowAll(!showAll); }} name="basic-inline-radio" label="With new chat button" id="new-chat-button" /> { setShowLogo(!showLogo); showCenteredLogo && setShowCenteredLogo(!showCenteredLogo); }} name="basic-inline-radio" label="With left-aligned logo" id="logo" /> { setShowCenteredLogo(!showCenteredLogo); showLogo && setShowLogo(!showLogo); showAll && setShowAll(!showAll); }} name="basic-inline-radio" label="With centered logo" id="logo-centered" /> { setShowSelectorDropdown(!showSelectorDropdown); showAll && setShowAll(!showAll); }} name="basic-inline-radio" label="With selector dropdown" id="selector-dropdown" /> { setShowOptionsDropdown(!showOptionsDropdown); showAll && setShowAll(!showAll); }} name="basic-inline-radio" label="With settings dropdown" id="options-dropdown" /> {(showMenu || showNewChatButton || showLogo || showCenteredLogo) && ( {showMenu && alert('Menu toggle clicked')} />} {showNewChatButton && alert('New chat button clicked')} />} {(showLogo || showCenteredLogo) && ( {showCenteredLogo ? {title} : title} )} )} {(showSelectorDropdown || showOptionsDropdown) && ( {showSelectorDropdown && ( Granite Code 7B Llama 3.0 Mistral 3B )} {showOptionsDropdown && ( } > Overlay } > Dock to window } > Fullscreen )} )} ); };