import React from 'react'; import { Layer, Tile } from '@carbon/react'; import { useTranslation } from 'react-i18next'; import { useLayoutType } from '@openmrs/esm-framework'; import styles from './error-state.scss'; export interface ErrorStateProps { error: any; headerTitle: string; } export const ErrorState: React.FC = ({ error, headerTitle }) => { const { t } = useTranslation('@openmrs/esm-patient-chart-app'); const isTablet = useLayoutType() === 'tablet'; return (

{headerTitle}

{t('error', 'Error')} {`${error?.response?.status}: `} {error?.response?.statusText}

{t( 'errorCopy', 'Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.', )}

); };