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

Function useTabs

frontend/public/swagger-ui-bundle.js:35468–35490  ·  view source on GitHub ↗
({ initialTab: s, isExecute: o, schema: i, example: a })

Source from the content-addressed store, hash-verified

35466 )
35467 }
35468 }
35469 const useTabs = ({ initialTab: s, isExecute: o, schema: i, example: a }) => {
35470 const u = (0, Re.useMemo)(() => ({ example: 'example', model: 'model' }), []),
35471 _ = (0, Re.useMemo)(() => Object.keys(u), [u]).includes(s) && i && !o ? s : u.example,
35472 w = ((s) => {
35473 const o = (0, Re.useRef)()
35474 return (
35475 (0, Re.useEffect)(() => {
35476 o.current = s
35477 }),
35478 o.current
35479 )
35480 })(o),
35481 [x, C] = (0, Re.useState)(_),
35482 j = (0, Re.useCallback)((s) => {
35483 C(s.target.dataset.name)
35484 }, [])
35485 return (
35486 (0, Re.useEffect)(() => {
35487 w && !o && a && C(u.example)
35488 }, [w, o, a]),
35489 { activeTab: x, onTabChange: j, tabs: u }
35490 )
35491 },
35492 model_example = ({
35493 schema: s,

Callers 1

model_exampleFunction · 0.85

Calls 3

CFunction · 0.70
includesMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected