import React from 'react'; import { AppBar as MuiAppBar, Box, Tab as MuiTab, Tabs, IconButton, Typography } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import SearchIcon from '@material-ui/icons/Search'; import LocalOfferIcon from '@material-ui/icons/LocalOffer'; import { Link, useHistory } from 'react-router-dom'; import { WindowType } from '../windows/Windows'; export enum AppBarTab { Query = 0, Tags, } export const appBarTabProps: Record = { [AppBarTab.Query]: { label: Query, path: "/query", }, [AppBarTab.Tags]: { label: Tags, path: "/tags", }, } export default function AppBar(props: { selectedTab: AppBarTab | null }) { const history = useHistory(); return <> error history.push(appBarTabProps[val].path)} variant="scrollable" scrollButtons="auto" > {Object.keys(appBarTabProps).map((tab: any, idx: number) => )} }