import { useState, FunctionComponent } from 'react';
import Message from '@patternfly/chatbot/dist/dynamic/Message';
import patternflyAvatar from './patternfly_avatar.jpg';
import { Checkbox, FormGroup, Flex, FlexItem } from '@patternfly/react-core';
export const MessageWithFeedbackExample: FunctionComponent = () => {
const [hasCloseButton, setHasCloseButton] = useState(false);
const [hasTextArea, setHasTextArea] = useState(false);
const [hasChildren, setHasChildren] = useState(false);
const [hasPrivacyStatement, setHasPrivacyStatement] = useState(false);
const children = <>This is additional content.>;
const privacyStatement = 'Do not share any personal or other sensitive information in your feedback.';
return (
<>
{
setHasTextArea(!hasTextArea);
}}
name="feedback-card-with-text-area"
label="Has text area"
id="has-text-area"
/>
{
setHasChildren(!hasChildren);
}}
name="feedback-card-with-children"
label="Has additional content"
id="has-children"
/>
{
setHasPrivacyStatement(!hasPrivacyStatement);
}}
name="feedback-card-with-privacy"
label="Has privacy statement"
id="has-privacy"
/>
alert(`Selected ${quickResponse} and received the additional feedback: ${additionalFeedback}`),
hasTextArea,
children: hasChildren ? children : undefined,
privacyStatement: hasPrivacyStatement ? privacyStatement : undefined,
// eslint-disable-next-line no-console
onClose: () => console.log('closed feedback form'),
focusOnLoad: false
}}
/>
alert(`Selected ${quickResponse} and received the additional feedback: ${additionalFeedback}`),
hasTextArea,
children: hasChildren ? children : undefined,
privacyStatement: hasPrivacyStatement ? privacyStatement : undefined,
// eslint-disable-next-line no-console
onClose: () => console.log('closed feedback form'),
focusOnLoad: false
}}
isCompact
/>
{
setHasCloseButton(!hasCloseButton);
}}
name="basic-inline-radio"
label="Has close button"
id="has-close"
/>
console.log('closed completion message') : undefined,
focusOnLoad: false
}}
/>
console.log('closed completion message') : undefined,
focusOnLoad: false
}}
isCompact
/>
>
);
};