+
+
+ {title}
+
+
+
+
+
+ );
+}
+
+/**
+ * Transient toasts for team-sharing events (``team.member_added`` and
+ * ``resource.shared``) delivered over the per-user SSE channel. Mirrors the
+ * ToolApprovalToast surface, but auto-dismisses since these are purely
+ * informational. Dismissal (manual or timed) is persisted so the SSE backlog
+ * replay on reload doesn't re-surface an already-seen notification.
+ */
+export default function TeamNotificationToast() {
+ const dispatch = useDispatch();
+ const { t } = useTranslation();
+ const events = useSelector(selectRecentEvents);
+ const dismissed = useSelector(selectDismissedShareNotifications);
+ const dismissedSet = useMemo(() => new Set(dismissed), [dismissed]);
+
+ const onDismiss = useCallback(
+ (id: string) => dispatch(dismissShareNotification(id)),
+ [dispatch],
+ );
+
+ const now = Date.now();
+ const visible: SSEEvent[] = [];
+ const seen = new Set