text: import * as React from 'react';
  import PropTypes from 'prop-types';
  import clsx from 'clsx';
  import { unstable_composeClasses as composeClasses } from '@mui/core';
  import Tablelvl2Context from '../Table/Tablelvl2Context';
  import useThemeProps from '../styles/useThemeProps';
  import styled from '../styles/styled';
  import { getTableHeadUtilityClass } from './tableHeadClasses';
  
  const useUtilityClasses = (ownerState) => {
    const { classes } = ownerState;
  
    const slots = {
      root: ['root'],
    };
  
    return composeClasses(slots, getTableHeadUtilityClass, classes);
  };
  
  const TableHeadRoot = styled('thead', {
    name: 'MuiTableHead',
    slot: 'Root',
    overridesResolver: (props, styles) => styles.root,
  })({
    display: 'table-header-group',
  });
  
  const tablelvl2 = {
    variant: 'head',
  };
  
  const defaultComponent = 'thead';
  
  const TableHead = React.forwardRef(function TableHead(inProps, ref) {
    const props = useThemeProps({ props: inProps, name: 'MuiTableHead' });
    const { className, component = defaultComponent, ...other } = props;
  
    const ownerState = {
      ...props,
      component,
    };
  
    const classes = useUtilityClasses(ownerState);
  
    return (
      <Tablelvl2Context.Provider value={tablelvl2}>
        <TableHeadRoot
          as={component}
          className={clsx(classes.root, className)}
          ref={ref}
          role={component === defaultComponent ? null : 'rowgroup'}
          ownerState={ownerState}
          {...other}
        />
      </Tablelvl2Context.Provider>
    );
  });
  
  TableHead.propTypes /* remove-proptypes */ = {
    // ----------------------------- Warning --------------------------------
    // | These PropTypes are generated from the TypeScript type definitions |
    // |     To update them edit the d.ts file and run "yarn proptypes"     |
    // ----------------------------------------------------------------------
    /**
     * The content of the component, normally `TableRow`.
     */
    children: PropTypes.node,
    /**
     * Override or extend the styles applied to the component.
     */
    classes: PropTypes.object,
    /**
     * @ignore
     */
    className: PropTypes.string,
    /**
     * The component used for the root node.
     * Either a string to use a HTML element or a component.
     */
    component: PropTypes.elementType,
    /**
     * The system prop that allows defining system overrides as well as additional CSS styles.
     */
    sx: PropTypes.object,
  };
  
  export default TableHead;
  