Hiyve Components - v1.0.0
    Preparing search index...

    Function useAlertToastsWithProvider

    • Hook that integrates useAlertToasts with cloud-provider's useAlerts

      This is a convenience hook that watches for new alerts and automatically shows them as toasts.

      Parameters

      Returns UseAlertToastsReturn

      import { useAlerts } from '@hiyve/react-intelligence';
      import { useAlertToastsWithProvider, AlertStack } from '@hiyve/react-intelligence';

      function MeetingRoom() {
      const alertsHook = useAlerts(roomId);
      const { toastAlerts, dismissToast } = useAlertToastsWithProvider(
      alertsHook.alerts,
      { enabled: true, maxVisible: 3 }
      );

      return (
      <AlertStack
      alerts={toastAlerts}
      onDismiss={(id) => dismissToast(id)}
      />
      );
      }