aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/settings/services/ServiceError.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/settings/services/ServiceError.tsx')
-rw-r--r--src/components/settings/services/ServiceError.tsx64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/components/settings/services/ServiceError.tsx b/src/components/settings/services/ServiceError.tsx
new file mode 100644
index 000000000..87efdeb96
--- /dev/null
+++ b/src/components/settings/services/ServiceError.tsx
@@ -0,0 +1,64 @@
1import { Component, ReactElement } from 'react';
2import { observer } from 'mobx-react';
3import { Link } from 'react-router-dom';
4import { defineMessages, injectIntl, WrappedComponentProps } from 'react-intl';
5import Infobox from '../../ui/Infobox';
6import Button from '../../ui/button';
7
8const messages = defineMessages({
9 headline: {
10 id: 'settings.service.error.headline',
11 defaultMessage: 'Error',
12 },
13 goBack: {
14 id: 'settings.service.error.goBack',
15 defaultMessage: 'Back to services',
16 },
17 availableServices: {
18 id: 'settings.service.form.availableServices',
19 defaultMessage: 'Available services',
20 },
21 errorMessage: {
22 id: 'settings.service.error.message',
23 defaultMessage: 'Could not load service recipe.',
24 },
25});
26
27interface IProps extends WrappedComponentProps {}
28
29@observer
30class ServiceError extends Component<IProps> {
31 render(): ReactElement {
32 const { intl } = this.props;
33
34 return (
35 <div className="settings__main">
36 <div className="settings__header">
37 <span className="settings__header-item">
38 <Link to="/settings/recipes">
39 {intl.formatMessage(messages.availableServices)}
40 </Link>
41 </span>
42 <span className="separator" />
43 <span className="settings__header-item">
44 {intl.formatMessage(messages.headline)}
45 </span>
46 </div>
47 <div className="settings__body">
48 <Infobox type="danger" icon="alert">
49 {intl.formatMessage(messages.errorMessage)}
50 </Infobox>
51 </div>
52 <div className="settings__controls">
53 <Button
54 label={intl.formatMessage(messages.goBack)}
55 htmlForm="form"
56 onClick={() => window.history.back()}
57 />
58 </div>
59 </div>
60 );
61 }
62}
63
64export default injectIntl(ServiceError);