2021-07-28 18:45:52 +05:30
|
|
|
import React from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
import './NotificationBadge.scss';
|
|
|
|
|
|
|
|
|
|
import Text from '../text/Text';
|
|
|
|
|
|
2021-08-28 18:16:20 +05:30
|
|
|
function NotificationBadge({ alert, content }) {
|
2021-07-28 18:45:52 +05:30
|
|
|
const notificationClass = alert ? ' notification-badge--alert' : '';
|
|
|
|
|
return (
|
|
|
|
|
<div className={`notification-badge${notificationClass}`}>
|
2021-12-16 17:55:16 +05:30
|
|
|
{content !== null && <Text variant="b3" weight="bold">{content}</Text>}
|
2021-07-28 18:45:52 +05:30
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NotificationBadge.defaultProps = {
|
|
|
|
|
alert: false,
|
2021-08-28 18:16:20 +05:30
|
|
|
content: null,
|
2021-07-28 18:45:52 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
|
|
NotificationBadge.propTypes = {
|
|
|
|
|
alert: PropTypes.bool,
|
2021-08-28 18:16:20 +05:30
|
|
|
content: PropTypes.oneOfType([
|
2021-07-28 18:45:52 +05:30
|
|
|
PropTypes.string,
|
|
|
|
|
PropTypes.number,
|
2021-08-28 18:16:20 +05:30
|
|
|
]),
|
2021-07-28 18:45:52 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default NotificationBadge;
|