1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

28 lines
684 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
export default function Dialog(props) {
const { children, type, className, onClick } = props;
return (
<div
className={classnames('dialog', className, {
'dialog--message': type === 'message',
'dialog--error': type === 'error',
'dialog--warning': type === 'warning',
})}
data-testid="dialog-message"
onClick={onClick}
>
{children}
</div>
);
}
Dialog.propTypes = {
className: PropTypes.string,
children: PropTypes.node,
type: PropTypes.oneOf(['message', 'error', 'warning']),
onClick: PropTypes.func,
};