UNPKG

@udus/notion-renderer

Version:
12 lines (11 loc) 1.05 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { splitTitleAndOtherProperties } from "../../../utils/index.js"; import { Icon } from "../../Common/Icon.js"; import { useMapper } from "../../hooks.js"; import { Properties } from "../../Property/Properties.js"; export const ListItem = ({ page }) => { const { Link } = useMapper(); const { title, other } = splitTitleAndOtherProperties(page.properties); return (_jsx("div", { id: page.id, className: "notion-list-item", children: _jsxs(Link, { prefix: "/", link: page.id, children: [_jsxs("div", { className: "notion-list-item-title", children: [_jsx("span", { className: "notion-list-item-title-icon", children: _jsx(Icon, { icon: page.icon }) }), _jsx("span", { className: "notion-list-item-title-text", children: title?.title.map((text) => text.plain_text).join("") ?? "Annoymous" })] }), _jsx("div", { className: "notion-list-item-properties", children: _jsx(Properties, { properties: other, hidePropertyName: true }) })] }) })); };