import { useEffect } from 'react'; import useResizeObserver from 'use-resize-observer'; import Penpot from '@ui/assets/penpot.svg?react'; import { PenpotExporter } from '@ui/components/PenpotExporter'; import { Stack } from '@ui/components/Stack'; import { Wrapper } from '@ui/components/Wrapper'; import { FigmaProvider } from '@ui/context/FigmaContext'; // Safe default value to avoid overflowing from the screen const MAX_HEIGHT = 800; export const App = () => { const { ref, height } = useResizeObserver({ box: 'border-box' }); useEffect(() => { if (height === undefined) return; const capHeight = Math.min(height, MAX_HEIGHT); parent.postMessage({ pluginMessage: { type: 'resize', height: capHeight } }, '*'); }, [height]); return ( MAX_HEIGHT}> ); };