summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/Content/Content.tsx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/components/Content/Content.tsx b/src/components/Content/Content.tsx
index 1341e4f..3d747b2 100644
--- a/src/components/Content/Content.tsx
+++ b/src/components/Content/Content.tsx
@@ -1,17 +1,15 @@
1import * as React from "react"; 1import * as React from "react";
2import {Dispatch, SetStateAction, useContext, useMemo} from "react"; 2import {Dispatch, SetStateAction, useContext, useMemo} from "react";
3import {RequestPayload, ResponsePayload} from "~hooks/useRequests"; 3import {RequestPayload, ResponsePayload, Headers} from "~hooks/useRequests";
4import ReactJson from 'react-json-view'; 4import ReactJson from 'react-json-view';
5import styles from './Content.module.scss'; 5import styles from './Content.module.scss';
6import {Button, Col, Container, Row} from "react-bootstrap"; 6import {Button, Col, Container, Row} from "react-bootstrap";
7import {DarkModeContext} from "../../contexts/DarkMode"; 7import {DarkModeContext} from "../../contexts/DarkMode";
8 8
9function getHeader(headers: { [key: string]: string }, key: string, unit?: string): string | null { 9function getHeader(headers: Headers, key: string, unit?: string): string | null {
10 console.log(headers, key) 10 console.log(headers, key)
11 try { 11 try {
12 const [_, value] = Object 12 const [_, value] = headers.find(([headerKey]) => headerKey.toLowerCase() === key.toLowerCase())
13 .entries(headers)
14 .find(([headerKey]) => headerKey.toLowerCase() === key.toLowerCase())
15 return unit !== undefined 13 return unit !== undefined
16 ? `${value}${unit}` 14 ? `${value}${unit}`
17 : value 15 : value