1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-19 19:49:37 +02:00
flame/client/src/components/NotificationCenter/NotificationCenter.tsx

29 lines
869 B
TypeScript
Raw Normal View History

2022-11-30 20:46:28 +00:00
import { useAtomValue } from 'jotai';
import { Notification as NotificationInterface } from '../../interfaces';
2022-11-30 20:46:28 +00:00
import { notificationsAtom } from '../../state/notification';
import { Notification } from '../UI';
2022-11-30 20:46:28 +00:00
import classes from './NotificationCenter.module.css';
export const NotificationCenter = (): JSX.Element => {
2022-11-30 20:46:28 +00:00
const { notifications } = useAtomValue(notificationsAtom);
return (
<div
className={classes.NotificationCenter}
style={{ height: `${notifications.length * 75}px` }}
>
{notifications.map((notification: NotificationInterface) => {
return (
<Notification
title={notification.title}
message={notification.message}
url={notification.url || null}
id={notification.id}
key={notification.id}
/>
);
})}
</div>
);
};