mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-22 04:49:36 +02:00
30 lines
878 B
TypeScript
30 lines
878 B
TypeScript
import { useSelector } from 'react-redux';
|
|
import { Notification as NotificationInterface } from '../../interfaces';
|
|
|
|
import classes from './NotificationCenter.module.css';
|
|
|
|
import { Notification } from '../UI';
|
|
import { State } from '../../store/reducers';
|
|
|
|
export const NotificationCenter = (): JSX.Element => {
|
|
const { notifications } = useSelector((state: State) => state.notification);
|
|
|
|
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>
|
|
);
|
|
};
|