"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;
const jsx_runtime_1 = require("react/jsx-runtime");
const CodeModal_1 = __importDefault(require("../CodeModal"));
const Chatbot_1 = require("../Chatbot");
const PreviewAttachment = ({ fileName, code, handleModalToggle, isModalOpen, onDismiss = undefined, onEdit, title = 'Preview attachment', primaryActionButtonText = 'Edit', secondaryActionButtonText = 'Dismiss', displayMode = Chatbot_1.ChatbotDisplayMode.default, modalHeaderClassName, modalBodyClassName, modalFooterClassName, isCompact }) => {
    const handleEdit = (_event) => {
        handleModalToggle(_event);
        onEdit(_event);
    };
    const handleDismiss = (_event) => {
        handleModalToggle(_event);
        onDismiss && onDismiss(_event);
    };
    return ((0, jsx_runtime_1.jsx)(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: primaryActionButtonText, secondaryActionBtn: secondaryActionButtonText, title: title, isReadOnly: true, displayMode: displayMode, isCompact: isCompact, modalHeaderClassName: modalHeaderClassName, modalBodyClassName: modalBodyClassName, modalFooterClassName: modalFooterClassName }));
};
exports.PreviewAttachment = PreviewAttachment;
exports.default = exports.PreviewAttachment;
