@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 (42 loc) • 1.14 kB
JavaScript
;
var jsxRuntime = require('react/jsx-runtime');
var components = require('../../components.cjs');
var Markdown = require('../../primitives/Markdown.cjs');
var cn = require('../../utils/cn.cjs');
var CodeBlock$1 = require('./CodeBlock.cjs');
function Link({ href, title, children }) {
const { Anchor } = components.useComponents();
return /* @__PURE__ */ jsxRuntime.jsx(Anchor, {
href,
title,
children
});
}
function CodeBlock({ language, code }) {
return /* @__PURE__ */ jsxRuntime.jsx(CodeBlock$1.CodeBlock, {
title: language || "Plain text",
code
});
}
const defaultMarkdownComponents = {
Link,
CodeBlock
};
function Prose({
content,
components: components$1,
className,
...props
}) {
return /* @__PURE__ */ jsxRuntime.jsx(components.ComponentsProvider, {
components: components$1,
children: /* @__PURE__ */ jsxRuntime.jsx(Markdown.Markdown, {
content,
components: { ...defaultMarkdownComponents, ...components$1?.markdown },
className: cn.cn("lb-prose", className),
...props
})
});
}
exports.Prose = Prose;
//# sourceMappingURL=Prose.cjs.map