MCPcopy Create free account
hub / github.com/dataease/SQLBot / request_snippets

Function request_snippets

frontend/public/swagger-ui-bundle.js:35268–35397  ·  view source on GitHub ↗
({ request: s, requestSnippetsSelectors: o, getComponent: i })

Source from the content-addressed store, hash-verified

35266 zIndex: '9999',
35267 borderBottom: 'none',
35268 },
35269 request_snippets = ({ request: s, requestSnippetsSelectors: o, getComponent: i }) => {
35270 const a = (0, Re.useRef)(null),
35271 u = i('ArrowUpIcon'),
35272 _ = i('ArrowDownIcon'),
35273 w = i('SyntaxHighlighter', !0),
35274 [x, C] = (0, Re.useState)(o.getSnippetGenerators()?.keySeq().first()),
35275 [j, L] = (0, Re.useState)(o?.getDefaultExpanded()),
35276 B = o.getSnippetGenerators(),
35277 $ = B.get(x),
35278 U = $.get('fn')(s),
35279 handleSetIsExpanded = () => {
35280 L(!j)
35281 },
35282 handleGetBtnStyle = (s) => (s === x ? Gn : Kn),
35283 handlePreventYScrollingBeyondElement = (s) => {
35284 const { target: o, deltaY: i } = s,
35285 { scrollHeight: a, offsetHeight: u, scrollTop: _ } = o
35286 a > u && ((0 === _ && i < 0) || (u + _ >= a && i > 0)) && s.preventDefault()
35287 }
35288 return (
35289 (0, Re.useEffect)(() => {}, []),
35290 (0, Re.useEffect)(() => {
35291 const s = Array.from(a.current.childNodes).filter(
35292 (s) => !!s.nodeType && s.classList?.contains('curl-command')
35293 )
35294 return (
35295 s.forEach((s) =>
35296 s.addEventListener('mousewheel', handlePreventYScrollingBeyondElement, {
35297 passive: !1,
35298 })
35299 ),
35300 () => {
35301 s.forEach((s) =>
35302 s.removeEventListener('mousewheel', handlePreventYScrollingBeyondElement)
35303 )
35304 }
35305 )
35306 }, [s]),
35307 Re.createElement(
35308 'div',
35309 { className: 'request-snippets', ref: a },
35310 Re.createElement(
35311 'div',
35312 {
35313 style: {
35314 width: '100%',
35315 display: 'flex',
35316 justifyContent: 'flex-start',
35317 alignItems: 'center',
35318 marginBottom: '15px',
35319 },
35320 },
35321 Re.createElement(
35322 'h4',
35323 { onClick: () => handleSetIsExpanded(), style: { cursor: 'pointer' } },
35324 'Snippets'
35325 ),

Callers

nothing calls this directly

Calls 12

handleSetIsExpandedFunction · 0.85
handleGetBtnStyleFunction · 0.85
containsMethod · 0.80
iFunction · 0.70
CFunction · 0.70
getMethod · 0.65
JnFunction · 0.50
firstMethod · 0.45
filterMethod · 0.45
fromMethod · 0.45
forEachMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected