openreplay/frontend/app/components/Header/NotificationItem.js
Shekar Siri 2ed5cac986
Webpack upgrade and dependency cleanup (#523)
* change(ui) - webpack update
* change(ui) - api optimize and other fixes
2022-06-03 16:47:38 +02:00

20 lines
654 B
JavaScript

import { checkForRecent } from 'App/dateRange';
import styles from './notificationItem.module.css';
const NotificationItem = ({
notification: {
notificationId, createdAt, name, text, viewed,
},
onClick,
}) => (
<div className={ styles.wrapper } data-viewed={ viewed } onClick={ () => (!viewed ? onClick(notificationId) : null) }>
<div className={ styles.time }>{ checkForRecent(createdAt, 'LLL dd, yyyy, hh:mm a') }</div>
<div className={ styles.title }>{ name }</div>
{ text && <div className={ styles.details }>{ text }</div> }
</div>
);
NotificationItem.displayName = 'NotificationItem';
export default NotificationItem;