import { Box, Code, Flex, Heading, Tab, TabList, TabPanel, TabPanels, Tabs, useColorModeValue, VStack, Spacer, GridItem, Grid, useDimensions, } from '@chakra-ui/react' import React from 'react' import { Doc } from '../types/Doc' import { Badges } from './Badges' import { Markdown } from './Markdown' import { CodeSnippet } from './CodeSnippet' let headerHeight = 75 export let MethodBox = ({ doc, responsive, }: { doc: Doc responsive: Object }) => { const replParent = React.useRef(null) /* deprecated: but documentation for the replacement is non existent atm. purpose: grabs updated sizes of reference needed: for ensuring the Iframe displays properly */ const replDimensions = useDimensions(replParent, true) return ( F.{doc.name} {doc.signature} {doc.description} {doc.example && Example} {doc.tests && Tests} {doc.source && Source} {doc.example && ( {doc.example} )} {doc.tests && ( {/* replDimensions uses the parent container and adjusts as needed, for the Iframe embedded*/} {doc.tests} )} {doc.source && ( {doc.source} )} ) }