import React, { FC } from 'react'; import { RouteComponentProps } from '@reach/router'; import { Alert, Table } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSpinner } from '@fortawesome/free-solid-svg-icons'; import { useFetch } from '../utils/useFetch'; export interface FlagMap { [key: string]: string; } const Flags: FC = () => { const { response, error } = useFetch('../api/v1/status/flags'); const body = () => { const flags: FlagMap = response && response.data; if (error) { return ( Error: Error fetching flags: {error.message} ); } else if (flags) { return ( {Object.keys(flags).map(key => { return ( ); })}
{key} {flags[key]}
); } return ; }; return ( <>

Command-Line Flags

{body()} ); }; export default Flags;