UNPKG

ds-markdown

Version:

> πŸš€ React Markdown ζ‰“ε­—εŠ¨η”»η»„δ»ΆοΌŒζδΎ›ηŽ°δ»£θŠε€©η•Œι’ζ•ˆζžœ

20 lines β€’ 1.06 kB
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; import { useMarkdownThemeContext } from '../../../context/MarkdownThemeProvider.js'; import CodeBlockWrap from '../CodeBlockWrap/index.js'; import CodeBlockActions from '../CodeBlockActions/index.js'; import './index.css'; const BlockWrap = ({ children, language, codeContent }) => { const { state: themeState } = useMarkdownThemeContext(); // Get theme config from context const currentCodeBlock = themeState.codeBlock; const { headerActions = true } = currentCodeBlock || {}; const renderHeaderActions = () => { if (headerActions === true) { return _jsx(CodeBlockActions, { codeContent: codeContent, language: language }); } return headerActions; }; return (_jsx(CodeBlockWrap, { title: _jsxs(_Fragment, { children: [_jsx("div", { className: "md-code-block-language", children: language }), renderHeaderActions()] }), children: children })); }; export default BlockWrap; //# sourceMappingURL=index.js.map