MCPcopy
hub / github.com/TanStack/query / Expander

Function Expander

packages/query-devtools/src/Explorer.tsx:47–87  ·  view source on GitHub ↗
(props: { expanded: boolean })

Source from the content-addressed store, hash-verified

45}
46
47const Expander = (props: { expanded: boolean }) => {
48 const theme = useTheme()
49 const css = useQueryDevtoolsContext().shadowDOMTarget
50 ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget })
51 : goober.css
52 const styles = createMemo(() => {
53 return theme() === 'dark' ? darkStyles(css) : lightStyles(css)
54 })
55
56 return (
57 <span
58 class={cx(
59 styles().expander,
60 css`
61 transform: rotate(${props.expanded ? 90 : 0}deg);
62 `,
63 props.expanded &&
64 css`
65 & svg {
66 top: -1px;
67 }
68 `,
69 )}
70 >
71 <svg
72 width="16"
73 height="16"
74 viewBox="0 0 16 16"
75 fill="none"
76 xmlns="http://www.w3.org/2000/svg"
77 >
78 <path
79 d="M6 12L10 8L6 4"
80 stroke-width="2"
81 stroke-linecap="round"
82 stroke-linejoin="round"
83 />
84 </svg>
85 </span>
86 )
87}
88
89type CopyState = 'NoCopy' | 'SuccessCopy' | 'ErrorCopy'
90const CopyButton = (props: { value: unknown }) => {

Callers

nothing calls this directly

Calls 4

useThemeFunction · 0.90
useQueryDevtoolsContextFunction · 0.90
darkStylesFunction · 0.70
lightStylesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…