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.

46 lines (41 loc) 1.6 kB
"use client"; 'use strict'; var jsxRuntime = require('react/jsx-runtime'); var react = require('react'); var overrides = require('../overrides.cjs'); require('../primitives/index.cjs'); var classNames = require('../utils/class-names.cjs'); var List = require('./internal/List.cjs'); var User = require('./internal/User.cjs'); var Timestamp = require('../primitives/Timestamp.cjs'); const AUTHORS_TRUNCATE = 3; const HistoryVersionSummary = react.forwardRef(({ version, selected, className, ...props }, forwardedRef) => { const $ = overrides.useOverrides(); return /* @__PURE__ */ jsxRuntime.jsxs("button", { ...props, className: classNames.classNames("lb-root lb-history-version-summary", className), ref: forwardedRef, "data-selected": selected ? "" : void 0, children: [ /* @__PURE__ */ jsxRuntime.jsx(Timestamp.Timestamp, { locale: $.locale, date: version.createdAt, className: "lb-date lb-history-version-summary-date" }), /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-history-version-summary-authors", children: /* @__PURE__ */ jsxRuntime.jsx(List.List, { values: version.authors.map((author) => /* @__PURE__ */ jsxRuntime.jsx(User.User, { userId: author.id, replaceSelf: true }, author.id)), formatRemaining: $.LIST_REMAINING_USERS, truncate: AUTHORS_TRUNCATE, locale: $.locale }) }) ] }); }); exports.HistoryVersionSummary = HistoryVersionSummary; //# sourceMappingURL=HistoryVersionSummary.cjs.map