Sha256: dadb6faf6464cc9bd39a3b29e7f70ffb6f861bff66e86ddb7c0be42142243223
Contents?: true
Size: 1.4 KB
Versions: 107
Compression:
Stored size: 1.4 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) => { 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
107 entries across 107 versions & 1 rubygems