Sha256: 22281e75fffddae7c82845fc551ac8a9a50f3dd14ad067bfd8564a90991a136e
Contents?: true
Size: 1.42 KB
Versions: 465
Compression:
Stored size: 1.42 KB
Contents
import React from "react"; import classnames from "classnames"; import { buildAriaProps, buildDataProps, buildHtmlProps, } from "../../utilities/props"; import { globalProps } from "../../utilities/globalProps"; type TableHeadPropTypes = { aria?: { [key: string]: string }; children: React.ReactNode[] | React.ReactNode; className: string; data?: { [key: string]: string }; htmlOptions?: { [key: string]: string | number | boolean | (() => void) }; id?: string; tag?: "table" | "div"; }; const TableHead = (props: TableHeadPropTypes): React.ReactElement => { const { aria = {}, children, className, data = {}, htmlOptions = {}, id, tag = "table", } = props; const ariaProps = buildAriaProps(aria); const dataProps = buildDataProps(data); const htmlProps = buildHtmlProps(htmlOptions); const classes = classnames("pb_table_thead", globalProps(props), className); const isTableTag = tag === "table"; return ( <> {isTableTag ? ( <thead {...ariaProps} {...dataProps} {...htmlProps} className={classes} id={id} > {children} </thead> ) : ( <div {...ariaProps} {...dataProps} {...htmlProps} className={classes} id={id} > {children} </div> )} </> ); }; export default TableHead;
Version data entries
465 entries across 465 versions & 1 rubygems