fix(frontend):fetchTabs prop type fix

This commit is contained in:
Alex Kaminskii 2022-12-13 15:52:12 +01:00
parent 7720869f29
commit cb0353cf3b

View file

@ -9,11 +9,6 @@ const REQUEST = 'REQUEST';
const RESPONSE = 'RESPONSE';
const TABS = [HEADERS, REQUEST, RESPONSE].map((tab) => ({ text: tab, key: tab }));
function isValidJSON(o: any): o is Object {
return typeof o === "object" && o != null
}
function parseRequestResponse(
r: string,
setHeaders: (hs: Record<string, string>) => void,
@ -45,10 +40,9 @@ function parseRequestResponse(
interface Props {
resource: any;
resource: { request: string, response: string };
}
function FetchTabs(props: Props) {
const { resource } = props;
function FetchTabs({ resource }: Props) {
const [activeTab, setActiveTab] = useState(HEADERS);
const onTabClick = (tab: string) => setActiveTab(tab);
const [jsonRequest, setJsonRequest] = useState<Object | null>(null);