import { localizeUrl } from '@automattic/i18n-utils'; import { translate } from 'i18n-calypso'; import type { APIError } from '@automattic/data-stores'; export const handleErrorMessage = ( error: APIError ): string => { switch ( error.status ) { case 500: return translate( 'Your website is experiencing technical issues. Please refer to our {{a}}support documentation{{/a}} for assistance in resolving this error.', { components: { a: ( ) as JSX.Element, }, } ) as string; default: // Return the default error message for other error codes return error.message; } };