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.

35 lines (31 loc) 871 B
"use client"; import { jsx } from 'react/jsx-runtime'; import { Slot } from '@radix-ui/react-slot'; import { forwardRef, useMemo } from 'react'; import { formatFileSize } from '../utils/format-file-size.js'; const FILE_SIZE_NAME = "FileSize"; const FileSize = forwardRef( ({ size, locale, children: renderChildren = formatFileSize, asChild, ...props }, forwardedRef) => { const Component = asChild ? Slot : "span"; const children = useMemo( () => typeof renderChildren === "function" ? renderChildren(size, locale) : renderChildren, [renderChildren, size] ); return /* @__PURE__ */ jsx(Component, { ...props, ref: forwardedRef, children }); } ); if (process.env.NODE_ENV !== "production") { FileSize.displayName = FILE_SIZE_NAME; } export { FileSize }; //# sourceMappingURL=FileSize.js.map