import React, { FC, useState } from 'react'; import { RouteComponentProps } from '@reach/router'; import { Alert, Button } from 'reactstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSpinner } from '@fortawesome/free-solid-svg-icons'; import CopyToClipboard from 'react-copy-to-clipboard'; import { useFetch } from '../utils/useFetch'; import './Config.css'; const Config: FC = () => { const { response, error } = useFetch('../api/v1/status/config'); const [copied, setCopied] = useState(false); const config = response && response.data.yaml; return ( <>

Configuration  { setCopied(result); setTimeout(setCopied, 1500); }} >

{error ? ( Error: Error fetching configuration: {error.message} ) : config ? (
{config}
) : ( )} ); }; export default Config;