// SPDX-License-Identifier: MIT // Copyright (c) 2021-2022 The Pybricks Authors // Provides special notification contents for unexpected errors. import { AnchorButton, Button, ButtonGroup, Intent } from '@blueprintjs/core'; import { useI18n } from '@shopify/react-i18n'; import React from 'react'; import { I18nId } from './i18n'; type UnexpectedErrorNotificationProps = { messageId: I18nId; err: Error; }; const UnexpectedErrorNotification: React.VoidFunctionComponent< UnexpectedErrorNotificationProps > = ({ messageId, err }) => { // istanbul ignore next: babel-loader rewrites this line const [i18n] = useI18n(); return ( <>
{i18n.translate(messageId, { errorMessage: err.message })}