UNPKG

piral-notifications

Version:

Plugin for triggering notifications in Piral.

10 lines 655 B
import * as React from 'react'; import { useGlobalState } from 'piral-core'; import { PiralNotificationsToast, PiralNotificationsHost } from './components'; export const Notifications = () => { const notifications = useGlobalState((s) => s.notifications); return (React.createElement(PiralNotificationsHost, null, notifications.map(({ component: Component, close, options, id }) => (React.createElement(PiralNotificationsToast, { onClose: close, options: options, key: id }, React.createElement(Component, { onClose: close, options: options })))))); }; Notifications.displayName = 'Notifications'; //# sourceMappingURL=Notifications.js.map