@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.
47 lines (43 loc) • 1.5 kB
JavaScript
"use client";
import { jsxs, jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useOverrides } from '../overrides.js';
import '../primitives/index.js';
import { cn } from '../utils/cn.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: cn("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