Files
endorsment/src/components/NotificationCenter.tsx
2026-02-15 11:20:49 -05:00

23 lines
648 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React from 'react';
import useAppStore from '../store/useAppStore';
const NotificationCenter: React.FC = () => {
const notifications = useAppStore((s) => s.notifications);
const removeNotification = useAppStore((s) => s.removeNotification);
if (!notifications || notifications.length === 0) return null;
return (
<div className="notif-container">
{notifications.map((n) => (
<div key={n.id} className={`notif ${n.type ?? ''}`}>
<div>{n.message}</div>
<button onClick={() => removeNotification(n.id)}>×</button>
</div>
))}
</div>
);
};
export default NotificationCenter;