"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.PreviewAttachment = void 0;
// ============================================================================
// Preview Attachment - Chatbot Code Snippet Viewer
// ============================================================================
const react_1 = __importDefault(require("react"));
const CodeModal_1 = __importDefault(require("../CodeModal"));
const Chatbot_1 = require("../Chatbot");
const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', displayMode = Chatbot_1.ChatbotDisplayMode.default }) => {
    const handleEdit = (_event) => {
        handleModalToggle(_event);
        onEdit(_event);
    };
    const handleDismiss = (_event) => {
        handleModalToggle(_event);
        onDismiss && onDismiss(_event);
    };
    return (react_1.default.createElement(CodeModal_1.default, { 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 }));
};
exports.PreviewAttachment = PreviewAttachment;
exports.default = exports.PreviewAttachment;
