import React, { useEffect } from "react"; import PropTypes from "prop-types"; import Checkbox from "../checkbox"; import { StyledTableGroupMenu } from "./StyledTableContainer"; import Button from "../button"; import ComboBox from "../combobox"; const TableGroupMenu = (props) => { const { isChecked, isIndeterminate, headerMenu, containerRef, onChange, checkboxOptions, columnStorageName, checkboxMargin, ...rest } = props; const onCheckboxChange = (e) => { onChange && onChange(e.target && e.target.checked); }; const width = containerRef.current ? containerRef.current.clientWidth + "px" : "100%"; useEffect(() => { const storageSize = localStorage.getItem(columnStorageName); if (containerRef.current) containerRef.current.style.gridTemplateColumns = storageSize; }, [containerRef]); return ( <>
{headerMenu.map((item, index) => { const { label, disabled, onClick } = item; return (