Show response body size

This commit is contained in:
Gregory Schier
2023-02-25 23:08:19 -08:00
parent b852484559
commit 67d8bbc154
2 changed files with 11 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import { forwardRef } from 'react';
import { Icon, IconProps } from './Icon';
import { Button, ButtonProps } from './Button';
import classnames from 'classnames';
type Props = Omit<IconProps, 'size'> & ButtonProps<typeof Button>;
@@ -10,7 +11,14 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(function IconButt
) {
return (
<Button ref={ref} className="group" {...props}>
<Icon icon={icon} spin={spin} className="text-gray-700 group-hover:text-gray-900" />
<Icon
icon={icon}
spin={spin}
className={classnames(
'text-gray-700 group-hover:text-gray-900',
props.disabled && 'opacity-70',
)}
/>
</Button>
);
});

View File

@@ -64,7 +64,8 @@ export function ResponsePane({ requestId, error }: Props) {
{response.status}
{response.statusReason && ` ${response.statusReason}`}
&nbsp;&bull;&nbsp;
{response.elapsed}ms
{response.elapsed}ms &nbsp;&bull;&nbsp;
{Math.round(response.body.length / 1000)} KB
</HStack>
{contentType.includes('html') ? (
<iframe