UNPKG

@udus/notion-renderer

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