More response info

This commit is contained in:
Gregory Schier
2024-01-28 16:02:49 -08:00
parent fbc878dbe5
commit 959841fb22
16 changed files with 230 additions and 89 deletions

View File

@@ -1,8 +1,17 @@
interface Props {
millis: number;
total: number;
headers: number;
}
export function DurationTag({ millis }: Props) {
export function DurationTag({ total, headers }: Props) {
return (
<span title={`HEADER: ${formatMillis(headers)}\nTOTAL: ${formatMillis(total)}`}>
{formatMillis(total)}
</span>
);
}
function formatMillis(millis: number) {
let num;
let unit;
@@ -17,9 +26,5 @@ export function DurationTag({ millis }: Props) {
unit = 'ms';
}
return (
<span title={`${millis} milliseconds`}>
{Math.round(num * 10) / 10} {unit}
</span>
);
return `${Math.round(num * 10) / 10} ${unit}`;
}

View File

@@ -15,7 +15,7 @@ export function Separator({
}: Props) {
return (
<div role="separator" className={classNames(className, 'flex items-center')}>
{children && <div className="text-xs text-gray-500 mx-2 whitespace-nowrap">{children}</div>}
{children && <div className="text-xs text-gray-500 mr-2 whitespace-nowrap">{children}</div>}
<div
className={classNames(
variant === 'primary' && 'bg-highlight',