UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

42 lines 1.29 kB
var _jsxFileName = "/home/runner/work/frontend-shared/frontend-shared/src/components/data/TableFoot.tsx"; import classnames from 'classnames'; import { useMemo } from 'preact/hooks'; import { downcastRef } from '../../util/typing'; import TableSectionContext from './TableSectionContext'; import { jsxDEV as _jsxDEV } from "preact/jsx-dev-runtime"; /** * Render a table footer section */ export default function TableFoot({ children, classes, elementRef, ...htmlAttributes }) { const sectionContext = useMemo(() => ({ section: 'foot' }), []); return _jsxDEV(TableSectionContext.Provider, { value: sectionContext, children: _jsxDEV("tfoot", { "data-component": "TableFoot", ...htmlAttributes, ref: downcastRef(elementRef), className: classnames( // This tfoot element will take up available extra vertical space when // a Table has sparse data. This prevents <TableRow>s from stretching // vertically to fill extra space. 'h-full', classes), children: children }, void 0, false, { fileName: _jsxFileName, lineNumber: 33, columnNumber: 7 }, this) }, void 0, false, { fileName: _jsxFileName, lineNumber: 32, columnNumber: 5 }, this); } //# sourceMappingURL=TableFoot.js.map