import { Box, Alert, Button, VStack, AlertIcon, AlertTitle, AlertDescription, } from '@chakra-ui/react'; import { NoConfig } from '~/elements'; import type { CenterProps } from '@chakra-ui/react'; import type { ConfigLoadError } from '~/util'; interface LoadErrorProps extends CenterProps { /** * Error thrown by `getHyperglassConfig` when any errors occur. */ error: ConfigLoadError; /** * Callback to retry the config fetch. */ retry: () => void; /** * If `true`, the UI is currently retrying the config fetch. */ inProgress: boolean; } /** * Error component to be displayed when the hyperglass UI is unable to communicate with the * hyperglass API to retrieve its configuration. */ export const LoadError = (props: LoadErrorProps): JSX.Element => { const { error, retry, inProgress, ...rest } = props; return ( Error Loading Configuration {error.baseMessage} {` ${error.url}`} {typeof error.detail !== 'undefined' && ( {error.detail} )} ); };