import React, { useState, FC } from 'react'; import { RouteComponentProps } from '@reach/router'; import { Button } from 'reactstrap'; import CopyToClipboard from 'react-copy-to-clipboard'; import { withStatusIndicator } from '../../components/withStatusIndicator'; import { useFetch } from '../../hooks/useFetch'; import { usePathPrefix } from '../../contexts/PathPrefixContext'; import { API_PATH } from '../../constants/constants'; type YamlConfig = { yaml?: string }; interface ConfigContentProps { error?: Error; data?: YamlConfig; } const YamlContent = ({ yaml }: YamlConfig) =>
{yaml}
; YamlContent.displayName = 'Config'; const ConfigWithStatusIndicator = withStatusIndicator(YamlContent); export const ConfigContent: FC = ({ error, data }) => { const [copied, setCopied] = useState(false); const config = data && data.yaml; return ( <>

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

); }; const Config: FC = () => { const pathPrefix = usePathPrefix(); const { response, error } = useFetch(`${pathPrefix}/${API_PATH}/status/config`); return ; }; export default Config;