notification-provider.tsx
1'use client';
2
3import { useNotification } from '@/hooks/use-notification';
4
5import * as Notification from '@/components/ui/notification';
6
7const NotificationProvider = () => {
8 const { notifications } = useNotification();
9
10 return (
11 <Notification.Provider>
12 {notifications.map(({ id, ...rest }) => {
13 return <Notification.Root key={id} {...rest} />;
14 })}
15 <Notification.Viewport />
16 </Notification.Provider>
17 );
18};
19
20export { NotificationProvider };
21