// ============================================================================ // Code Modal - Chatbot Modal with Code Editor // ============================================================================ import type { FunctionComponent } from 'react'; // Import PatternFly components import { Modal, ModalProps } from '@patternfly/react-core'; import { ChatbotDisplayMode } from '../Chatbot'; export interface ChatbotModalProps extends Omit { /** Display mode for the Chatbot parent; this influences the styles applied */ displayMode?: ChatbotDisplayMode; /** Additional className applied to modal */ className?: string; /** Sets modal to compact styling. */ isCompact?: boolean; } export const ChatbotModal: FunctionComponent = ({ children, displayMode = ChatbotDisplayMode.default, className, isOpen, isCompact, ...props }: ChatbotModalProps) => { const modal = ( {children} ); if ((displayMode === ChatbotDisplayMode.fullscreen || displayMode === ChatbotDisplayMode.embedded) && isOpen) { return
{modal}
; } return modal; }; export default ChatbotModal;