-
Notifications
You must be signed in to change notification settings - Fork 9
/
WindowAlert.jsx
executable file
·46 lines (42 loc) · 1.15 KB
/
WindowAlert.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import WindowAbstract from '../Window/Window';
import ButtonForm from '../ButtonForm';
import './_WindowAlert.scss';
const WindowAlert = props => (
<WindowAbstract
className={cx('WindowAlert', props.className)}
onClose={props.onClose}
onHelp={props.onHelp}
title={props.title || 'Error'}
resizable={false}
>
<div
className={cx('WindowAlert__message', { 'has-icon': props.icon })}
style={props.icon && { backgroundImage: `url(${props.icon})` }}
>
{props.children}
</div>
<div className="WindowAlert__actions">
{props.onOK && (
<ButtonForm className="WindowAlert__ok" onClick={props.onOK}>
OK
</ButtonForm>
)}
{props.onCancel && (
<ButtonForm className="WindowAlert__cancel" onClick={props.onCancel}>
Cancel
</ButtonForm>
)}
</div>
</WindowAbstract>
);
WindowAlert.propTypes = {
...WindowAbstract.propTypes,
onOK: PropTypes.func,
onCancel: PropTypes.func,
children: PropTypes.node,
icon: PropTypes.string,
};
export default WindowAlert;