Project

General

Profile

Download (796 Bytes) Statistics
| Branch: | Tag: | Revision:
import React from 'react';
import NotificationPanelHeading from './NotificationPanelHeading';
import NotificationPanelBody from './NotificationPanelBody';

const NotificationPanel = ({notifications, title, id, expandedGroup}) => {
let unread;

if (notifications) {
unread = notifications.reduce((total, curr) => {
if (!curr.seen) {
total = total + 1;
}
return total;
}, 0);
} else {
unread = 0;
}

return (
<div className="panel panel-default">
<NotificationPanelHeading title={title} group={id} unread={unread}/>
<NotificationPanelBody notifications={notifications}
group={id} expandedGroup={expandedGroup}/>
</div>
);
};

export default NotificationPanel;

(11-11/17)