import { useRef, useState, FunctionComponent, MouseEvent, CSSProperties, Ref, MouseEvent as ReactMouseEvent } from 'react'; import { Button, SkipToContent, MenuToggle, MenuToggleElement, Select, SelectList, SelectOption, Stack } from '@patternfly/react-core'; import TermsOfUse from '@patternfly/chatbot/dist/dynamic/TermsOfUse'; import Chatbot, { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot'; export const TermsOfUseCompactExample: FunctionComponent = () => { const [isModalOpen, setIsModalOpen] = useState(true); const [displayMode, setDisplayMode] = useState(ChatbotDisplayMode.default); const chatbotRef = useRef(null); const termsRef = useRef(null); const [isOpen, setIsOpen] = useState(false); const [selected, setSelected] = useState('Select display mode'); const handleSkipToContent = (e) => { e.preventDefault(); if (!isModalOpen && chatbotRef.current) { chatbotRef.current.focus(); } if (isModalOpen && termsRef.current) { termsRef.current.focus(); } }; const handleModalToggle = (_event: ReactMouseEvent | MouseEvent | KeyboardEvent) => { setIsModalOpen(!isModalOpen); }; const onPrimaryAction = () => { // eslint-disable-next-line no-console console.log('Clicked primary action'); }; const onSecondaryAction = () => { // eslint-disable-next-line no-console console.log('Clicked secondary action'); }; const onSelect = (_event: ReactMouseEvent | undefined, value: string | number | undefined) => { setSelected(value as string); setIsOpen(false); if (value === 'Default') { setDisplayMode(ChatbotDisplayMode.default); } if (value === 'Docked') { setDisplayMode(ChatbotDisplayMode.docked); } if (value === 'Fullscreen') { setDisplayMode(ChatbotDisplayMode.fullscreen); } if (value === 'Embedded') { setDisplayMode(ChatbotDisplayMode.embedded); } }; const onToggleClick = () => { setIsOpen(!isOpen); }; const toggle = (toggleRef: Ref) => ( {selected} ); const introduction = ( <>

Welcome to PatternFly! These terms and conditions outline the rules and regulations for the use of PatternFly's website, located at www.patternfly.org.

By accessing this website, you are agreeing with our terms and conditions. If you do not agree to all of these terms and conditions, do not continue to use PatternFly.

); const terminology = ( <>

The following terminology applies to these Terms and Conditions, Privacy Statement, Disclaimer Notice, and all Agreements:

  • "Client", "You", and "Your" refer to you, the person using this website who is compliant with the Company's terms and conditions.
  • "The Company", "Ourselves", "We", "Our", and "Us", refer to our Company. "Party", "Parties", or "Us", refers to both the Client and ourselves.
); const body = ( <>

Introduction

{introduction}

Terminology

{terminology} ); return ( <> Skip to chatbot
{body} ); };