UNPKG

@liveblocks/react-ui

Version:

A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.

43 lines (38 loc) 1.25 kB
"use client"; 'use strict'; var jsxRuntime = require('react/jsx-runtime'); var react = require('react'); var classNames = require('../utils/class-names.cjs'); var useVisible = require('../utils/use-visible.cjs'); function ReachEndMarker({ enabled, onReachEnd }) { const markerRef = react.useRef(null); useVisible.useVisibleCallback(markerRef, onReachEnd, { enabled }); return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: markerRef, style: { height: 0 } }); } const InboxNotificationList = react.forwardRef(({ onReachEnd, children, className, ...props }, forwardedRef) => { return /* @__PURE__ */ jsxRuntime.jsxs("ol", { className: classNames.classNames("lb-root lb-inbox-notification-list", className), ...props, ref: forwardedRef, children: [ react.Children.map(children, (child, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "lb-inbox-notification-list-item", children: child }, index)), onReachEnd && /* @__PURE__ */ jsxRuntime.jsx(ReachEndMarker, { onReachEnd, enabled: react.Children.count(children) > 0 }) ] }); }); exports.InboxNotificationList = InboxNotificationList; //# sourceMappingURL=InboxNotificationList.cjs.map