MCPcopy Create free account
hub / github.com/TanStack/devtools / ContentPanel

Function ContentPanel

packages/devtools/src/components/content-panel.tsx:5–24  ·  view source on GitHub ↗
(props: {
  ref: (el: HTMLDivElement | undefined) => void
  children: JSX.Element
  handleDragStart?: (e: any) => void
})

Source from the content-addressed store, hash-verified

3 createHeight,
4} from '../context/use-devtools-context'
5import { createStyles } from '../styles/use-styles'
6import { createPiPWindow } from '../context/pip-context'
7import {
8 PANEL_CLOSE_THRESHOLD,
9 PANEL_MAX_VIEWPORT_RATIO,
10} from '../utils/constants'
11import type { JSX } from 'solid-js/jsx-runtime'
12
13export const ContentPanel = (props: {
14 ref: (el: HTMLDivElement | undefined) => void
15 children: JSX.Element
16 handleDragStart?: (event: MouseEvent) => void
17 handleHeightChange?: (height: number) => void
18}) => {
19 const styles = createStyles()
20 const { settings } = createDevtoolsSettings()
21 const { height } = createHeight()
22 const pip = createPiPWindow()
23 const maxHeight = () =>
24 Math.floor(window.innerHeight * PANEL_MAX_VIEWPORT_RATIO)
25 const clampedHeight = () =>
26 Math.min(maxHeight(), Math.max(PANEL_CLOSE_THRESHOLD, Math.round(height())))
27 const resizeWithKeyboard: JSX.EventHandlerUnion<

Callers

nothing calls this directly

Calls 2

createStylesFunction · 0.90
createDevtoolsSettingsFunction · 0.90

Tested by

no test coverage detected