(props: HeadersProps)
| 34 | } |
| 35 | |
| 36 | export function Headers(props: HeadersProps) { |
| 37 | const { headers } = props |
| 38 | const { isOpen, onToggle } = useDisclosure() |
| 39 | |
| 40 | const headersList = Object.entries(headers) |
| 41 | |
| 42 | return ( |
| 43 | <Box> |
| 44 | {' '} |
| 45 | <Flex alignItems={'center'}> |
| 46 | <Text as="h2" fontWeight={'bold'} mb="1"> |
| 47 | Headers |
| 48 | </Text> |
| 49 | <IconButton |
| 50 | aria-label="Expand headers" |
| 51 | icon={isOpen ? <ChevronUpIcon /> : <ChevronDownIcon />} |
| 52 | onClick={onToggle} |
| 53 | variant="ghost" |
| 54 | size={'xs'} |
| 55 | fontSize="md" |
| 56 | > |
| 57 | {' '} |
| 58 | </IconButton> |
| 59 | </Flex> |
| 60 | <Collapse in={isOpen} animateOpacity> |
| 61 | {headersList.length == 0 && <Text fontStyle={'italic'}>No headers...</Text>} |
| 62 | |
| 63 | {headersList.map(([key, value], i) => { |
| 64 | return ( |
| 65 | <Box mb="2" key={i}> |
| 66 | <Input |
| 67 | px="1" |
| 68 | size={'sm'} |
| 69 | variant="filled" |
| 70 | readOnly |
| 71 | value={key} |
| 72 | mb="1" |
| 73 | backgroundColor={'gray.800'} |
| 74 | ></Input> |
| 75 | <Input px="1" size={'sm'} variant="filled" readOnly value={value} backgroundColor={'gray.800'}></Input> |
| 76 | </Box> |
| 77 | ) |
| 78 | })} |
| 79 | </Collapse> |
| 80 | </Box> |
| 81 | ) |
| 82 | } |
| 83 | |
| 84 | export interface StatusCodeInfoProps { |
| 85 | statusCode: number |
nothing calls this directly
no outgoing calls
no test coverage detected