mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-23 09:18:30 +02:00
Fix response header table sizing
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import type { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
import type { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
||||||
|
|
||||||
export function KeyValueRows({
|
interface Props {
|
||||||
children,
|
|
||||||
}: {
|
|
||||||
children:
|
children:
|
||||||
| ReactElement<HTMLAttributes<HTMLTableColElement>>
|
| ReactElement<HTMLAttributes<HTMLTableColElement>>
|
||||||
| ReactElement<HTMLAttributes<HTMLTableColElement>>[];
|
| ReactElement<HTMLAttributes<HTMLTableColElement>>[];
|
||||||
}) {
|
}
|
||||||
|
|
||||||
|
export function KeyValueRows({ children }: Props) {
|
||||||
children = Array.isArray(children) ? children : [children];
|
children = Array.isArray(children) ? children : [children];
|
||||||
return (
|
return (
|
||||||
<table className="text-xs font-mono min-w-0 w-full mb-auto">
|
<table className="text-xs font-mono min-w-0 w-full mb-auto">
|
||||||
@@ -20,19 +20,24 @@ export function KeyValueRows({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Props {
|
interface KeyValueRowProps {
|
||||||
label: ReactNode;
|
label: ReactNode;
|
||||||
value: ReactNode;
|
value: ReactNode;
|
||||||
labelClassName?: string;
|
labelClassName?: string;
|
||||||
labelColor?: 'secondary' | 'primary' | 'info';
|
labelColor?: 'secondary' | 'primary' | 'info';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function KeyValueRow({ label, value, labelColor = 'secondary', labelClassName }: Props) {
|
export function KeyValueRow({
|
||||||
|
label,
|
||||||
|
value,
|
||||||
|
labelColor = 'secondary',
|
||||||
|
labelClassName,
|
||||||
|
}: KeyValueRowProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<td
|
<td
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'py-0.5 pr-2 select-text cursor-text',
|
'py-0.5 pr-2 select-text cursor-text whitespace-nowrap',
|
||||||
labelClassName,
|
labelClassName,
|
||||||
labelColor === 'primary' && 'text-primary',
|
labelColor === 'primary' && 'text-primary',
|
||||||
labelColor === 'secondary' && 'text-text-subtle',
|
labelColor === 'secondary' && 'text-text-subtle',
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ export function useHttpRequestActions() {
|
|||||||
const responses = (await invokeCmd(
|
const responses = (await invokeCmd(
|
||||||
'cmd_http_request_actions',
|
'cmd_http_request_actions',
|
||||||
)) as GetHttpRequestActionsResponse[];
|
)) as GetHttpRequestActionsResponse[];
|
||||||
console.log('REQUEST ACTIONS', responses);
|
|
||||||
return responses;
|
return responses;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user