import cheerio from 'cheerio';
import { MbNode } from '../utils/node.js';
import {
CONTAINER_HTML,
doesFunctionBtnContainerExistInNode,
isFunctionBtnContainer,
} from './codeBlockButtonsAssets/codeBlockButtonsContainer.js';
import type { PluginContext } from './Plugin.js';
const CSS_FILE_NAME = 'codeBlockButtonsAssets/codeBlockButtons.css';
const COPY_ICON = `
`;
const COPY_MESSAGE = 'Copy';
const COPY_MESSAGE_SUCCESS = 'Copied!';
const TICK_ICON = `
`;
function getButtonHTML() {
const html = ``;
return html;
}
const copyCodeBlockScript = ``;
const getLinks = () => [``];
const getScripts = () => [copyCodeBlockScript];
const processNode = (_: PluginContext, node: MbNode) => {
if (node.name === 'pre' && node.children?.some(child => child.name === 'code')) {
if (!doesFunctionBtnContainerExistInNode(node)) {
cheerio(node).append(CONTAINER_HTML);
}
} else if (isFunctionBtnContainer(node)) {
cheerio(node).append(getButtonHTML());
}
};
export {
getLinks,
getScripts,
processNode,
};