Files
pybricks-code/src/app/alerts/UpdateServerFailure.tsx
T
David Lechner bf4670b25d update to react 18
We were stuck on react 16.x for a long time but dependencies seem to
have caught up enough that migration is trivial now.
2023-05-17 16:33:47 -05:00

20 lines
597 B
TypeScript

// SPDX-License-Identifier: MIT
// Copyright (c) 2022-2023 The Pybricks Authors
import { Intent } from '@blueprintjs/core';
import React from 'react';
import type { CreateToast } from '../../toasterTypes';
import { useI18n } from './i18n';
const UpdateServerFailure: React.FunctionComponent = () => {
const i18n = useI18n();
return <p>{i18n.translate('updateServerFailure.message')}</p>;
};
export const updateServerFailure: CreateToast = (onAction) => ({
message: <UpdateServerFailure />,
icon: 'error',
intent: Intent.DANGER,
onDismiss: () => onAction('dismiss'),
});