2022-05-20 04:15:43 +00:00
|
|
|
import classNames from 'classnames';
|
2018-01-13 02:01:27 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import React from 'react';
|
|
|
|
import { kinds } from 'Helpers/Props';
|
|
|
|
import styles from './Alert.css';
|
|
|
|
|
2023-01-15 18:47:40 +00:00
|
|
|
function Alert(props) {
|
|
|
|
const { className, kind, children, ...otherProps } = props;
|
|
|
|
|
2018-01-13 02:01:27 +00:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
className,
|
|
|
|
styles[kind]
|
|
|
|
)}
|
|
|
|
{...otherProps}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
Alert.propTypes = {
|
2023-01-15 18:47:40 +00:00
|
|
|
className: PropTypes.string,
|
|
|
|
kind: PropTypes.oneOf(kinds.all),
|
2018-01-13 02:01:27 +00:00
|
|
|
children: PropTypes.node.isRequired
|
|
|
|
};
|
|
|
|
|
|
|
|
Alert.defaultProps = {
|
|
|
|
className: styles.alert,
|
|
|
|
kind: kinds.INFO
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Alert;
|