mirror of
https://github.com/array-in-a-matrix/xinny.git
synced 2024-05-18 20:30:19 -04:00
29 lines
635 B
JavaScript
29 lines
635 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import './NotificationBadge.scss';
|
|
|
|
import Text from '../text/Text';
|
|
|
|
function NotificationBadge({ alert, children }) {
|
|
const notificationClass = alert ? ' notification-badge--alert' : '';
|
|
return (
|
|
<div className={`notification-badge${notificationClass}`}>
|
|
<Text variant="b3">{children}</Text>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
NotificationBadge.defaultProps = {
|
|
alert: false,
|
|
};
|
|
|
|
NotificationBadge.propTypes = {
|
|
alert: PropTypes.bool,
|
|
children: PropTypes.oneOfType([
|
|
PropTypes.string,
|
|
PropTypes.number,
|
|
]).isRequired,
|
|
};
|
|
|
|
export default NotificationBadge;
|