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.

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