MCPcopy Index your code
hub / github.com/dataease/SQLBot / components_HighlightCode

Function components_HighlightCode

frontend/public/swagger-ui-bundle.js:58383–58454  ·  view source on GitHub ↗
({
            fileName: s = 'response.txt',
            className: o,
            downloadable: i,
            getComponent: a,
            canCopy: u,
            language: _,
            children: w,
          })

Source from the content-addressed store, hash-verified

58381 }
58382 var $O = __webpack_require__(5419),
58383 qO = __webpack_require__.n($O)
58384 const components_HighlightCode = ({
58385 fileName: s = 'response.txt',
58386 className: o,
58387 downloadable: i,
58388 getComponent: a,
58389 canCopy: u,
58390 language: _,
58391 children: w,
58392 }) => {
58393 const x = (0, Re.useRef)(null),
58394 C = a('SyntaxHighlighter', !0),
58395 handlePreventYScrollingBeyondElement = (s) => {
58396 const { target: o, deltaY: i } = s,
58397 { scrollHeight: a, offsetHeight: u, scrollTop: _ } = o
58398 a > u && ((0 === _ && i < 0) || (u + _ >= a && i > 0)) && s.preventDefault()
58399 }
58400 return (
58401 (0, Re.useEffect)(() => {
58402 const s = Array.from(x.current.childNodes).filter(
58403 (s) => !!s.nodeType && s.classList.contains('microlight')
58404 )
58405 return (
58406 s.forEach((s) =>
58407 s.addEventListener('mousewheel', handlePreventYScrollingBeyondElement, {
58408 passive: !1,
58409 })
58410 ),
58411 () => {
58412 s.forEach((s) =>
58413 s.removeEventListener('mousewheel', handlePreventYScrollingBeyondElement)
58414 )
58415 }
58416 )
58417 }, [w, o, _]),
58418 Re.createElement(
58419 'div',
58420 { className: 'highlight-code', ref: x },
58421 u &&
58422 Re.createElement(
58423 'div',
58424 { className: 'copy-to-clipboard' },
58425 Re.createElement(
58426 Hn.CopyToClipboard,
58427 { text: w },
58428 Re.createElement('button', null)
58429 )
58430 ),
58431 i
58432 ? Re.createElement(
58433 'button',
58434 {
58435 className: 'download-contents',
58436 onClick: () => {
58437 qO()(w, s)
58438 },
58439 },
58440 'Download'

Callers

nothing calls this directly

Calls 7

qOFunction · 0.85
containsMethod · 0.80
aFunction · 0.70
JnFunction · 0.50
filterMethod · 0.45
fromMethod · 0.45
forEachMethod · 0.45

Tested by

no test coverage detected