All files / src/components/ErrorDialog index.jsx

0% Statements 0/22
0% Branches 0/6
0% Functions 0/4
0% Lines 0/11
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                                                           
import styles from './style.postcss';
 
import React from 'react';
import Dialog from 'components/Dialog';
import Button from 'components/Button';
import Icon from 'components/Icon';
import PropTypes from 'prop-types';
 
const ErrorDialog = ({ onConfirmClick, isOpen }) => <Dialog withCloseButton
    isOpen={isOpen}
    onRequestClose={(source) => (source === 'button' ? onConfirmClick() : null)}>
  <div className={styles.ErrorDialog}>
    <Icon id="warning" className={styles.ErrorDialog_icon} />
    <div className={styles.ErrorDialog_content}>
      <span>An error occurred!</span>
    </div>
    <Button.Container className={styles.ErrorDialog_buttons}
        align="center">
      <Button type={Button.Type.primary} onClick={() => onConfirmClick()}>OK</Button>
    </Button.Container>
  </div>
</Dialog>;
 
ErrorDialog.propTypes = {
  isOpen: PropTypes.bool,
  onConfirmClick: PropTypes.func,
};
 
export default ErrorDialog;