UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

11 lines (10 loc) 623 B
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-file` element — a summary card showing the heading and description. */ export function FileCard({ 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 })] })); }