Sha256: a10942de81ce83add0538bb1b6ac1cf895abb925847a059fdf6216f118bd00d1
Contents?: true
Size: 1.46 KB
Versions: 465
Compression:
Stored size: 1.46 KB
Contents
import React from "react"; import classnames from "classnames"; import { buildAriaProps, buildDataProps, buildHtmlProps, } from "../../utilities/props"; import { globalProps } from "../../utilities/globalProps"; type TableHeaderPropTypes = { 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"; text?: string; }; const TableHeader = (props: TableHeaderPropTypes): React.ReactElement => { const { aria = {}, children, className, data = {}, htmlOptions = {}, id, tag = "table", text } = props; const ariaProps = buildAriaProps(aria); const dataProps = buildDataProps(data); const htmlProps = buildHtmlProps(htmlOptions); const classes = classnames("pb_table_th", globalProps(props), className); const isTableTag = tag === "table"; return ( <> {isTableTag ? ( <th {...ariaProps} {...dataProps} {...htmlProps} className={classes} id={id} > {text || children} </th> ) : ( <div {...ariaProps} {...dataProps} {...htmlProps} className={classes} id={id} > {text || children} </div> )} </> ); }; export default TableHeader;
Version data entries
465 entries across 465 versions & 1 rubygems