diff options
| author | 2022-02-08 15:33:16 +0100 | |
|---|---|---|
| committer | 2022-02-08 15:33:16 +0100 | |
| commit | 5dbf880ce3cdb227a85dbb0015609c210557c60b (patch) | |
| tree | 978449026b8d31b99e9eee67fb00d2f75ab47efb /src/components/Content/Content.tsx | |
| parent | efb3fae035c7773a233d2bb3ecc455a956c80eff (diff) | |
| download | client-5dbf880ce3cdb227a85dbb0015609c210557c60b.tar.gz client-5dbf880ce3cdb227a85dbb0015609c210557c60b.tar.bz2 client-5dbf880ce3cdb227a85dbb0015609c210557c60b.zip | |
Fixed rendering of contentv1.2.3
Diffstat (limited to 'src/components/Content/Content.tsx')
| -rw-r--r-- | src/components/Content/Content.tsx | 8 |
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 @@ | |||
| 1 | import * as React from "react"; | 1 | import * as React from "react"; |
| 2 | import {Dispatch, SetStateAction, useContext, useMemo} from "react"; | 2 | import {Dispatch, SetStateAction, useContext, useMemo} from "react"; |
| 3 | import {RequestPayload, ResponsePayload} from "~hooks/useRequests"; | 3 | import {RequestPayload, ResponsePayload, Headers} from "~hooks/useRequests"; |
| 4 | import ReactJson from 'react-json-view'; | 4 | import ReactJson from 'react-json-view'; |
| 5 | import styles from './Content.module.scss'; | 5 | import styles from './Content.module.scss'; |
| 6 | import {Button, Col, Container, Row} from "react-bootstrap"; | 6 | import {Button, Col, Container, Row} from "react-bootstrap"; |
| 7 | import {DarkModeContext} from "../../contexts/DarkMode"; | 7 | import {DarkModeContext} from "../../contexts/DarkMode"; |
| 8 | 8 | ||
| 9 | function getHeader(headers: { [key: string]: string }, key: string, unit?: string): string | null { | 9 | function 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 |
