shelving
Version:
Toolkit for using data in JavaScript.
11 lines (10 loc) • 633 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { joinPath } from "../../util/path.js";
import { Card } from "../block/Card.js";
import { Paragraph } from "../block/Paragraph.js";
import { Subheading } from "../block/Subheading.js";
/** Card renderer for a `tree-directory` element — a summary card showing the heading and description. */
export function DirectoryCard({ path, name, title, description }) {
const href = joinPath(path, name);
return (_jsxs(Card, { href: href, children: [_jsx(Subheading, { children: title ?? name }), description && _jsx(Paragraph, { children: description })] }));
}