// ============================================================================
// Preview Attachment - Chatbot Code Snippet Viewer
// ============================================================================
import React from 'react';
import CodeModal from '../CodeModal';
import { ChatbotDisplayMode } from '../Chatbot';
export const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', displayMode = ChatbotDisplayMode.default, isCompact }) => {
    const handleEdit = (_event) => {
        handleModalToggle(_event);
        onEdit(_event);
    };
    const handleDismiss = (_event) => {
        handleModalToggle(_event);
        onDismiss && onDismiss(_event);
    };
    return (React.createElement(CodeModal, { codeEditorControlClassName: "pf-chatbot__code-modal--controls", code: code, fileName: fileName, handleModalToggle: handleModalToggle, isCopyEnabled: true, isLineNumbersVisible: false, isModalOpen: isModalOpen, onPrimaryAction: handleEdit, onSecondaryAction: handleDismiss, primaryActionBtn: "Edit", secondaryActionBtn: "Dismiss", title: title, isReadOnly: true, displayMode: displayMode, isCompact: isCompact }));
};
export default PreviewAttachment;
