import { useState, FunctionComponent, MouseEvent as ReactMouseEvent } from 'react'; import Message from '@patternfly/chatbot/dist/dynamic/Message'; import patternflyAvatar from './patternfly_avatar.jpg'; import { CopyIcon, WrenchIcon } from '@patternfly/react-icons'; import { Button, DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm, ExpandableSection, ExpandableSectionVariant, Flex, FlexItem, Label } from '@patternfly/react-core'; export const MessageWithToolResponseExample: FunctionComponent = () => { const [isExpanded, setIsExpanded] = useState(false); const onToggle = (_event: ReactMouseEvent, isExpanded: boolean) => { setIsExpanded(isExpanded); }; const toolResponseBody = `The tool processed **3 database queries** and returned the following results: 1. User data - *42 records* 2. Transaction history - *128 records* 3. Analytics metrics - *15 data points* \`\`\`json { "status": "success", "execution_time": "0.12s" } \`\`\``; return ( Completed in 0.12 seconds', body: toolResponseBody, isBodyMarkdown: true, cardTitle: ( toolName Execution time: 0.12 seconds ), cardBody: ( <> Parameters Optional description text for parameters. Response Descriptive text about the tool response, including completion status, details on the data that was processed, or anything else relevant to the use case. ) }} /> ); };