text: import _pt from "prop-types";
  
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
  
  import React from 'react';
  import useStyles from '../../hooks/useStyles';
  import { styleSheetCell as styleSheet } from './styles';
  
  /** An individual table cell. */
  export default function TableCell(_ref) {
    let {
      centerAlign,
      children,
      header,
      startAlign,
      endAlign,
      truncate,
      wrap
    } = _ref,
        props = _objectWithoutPropertiesLoose(_ref, ["centerAlign", "children", "header", "startAlign", "endAlign", "truncate", "wrap"]);
  
    const [styles, cx] = useStyles(styleSheet);
    const Tag = header ? 'th' : 'td';
    return React.createElement(Tag, _extends({}, props, {
      className: cx(truncate && styles.cell_truncate, startAlign && styles.cell_left, centerAlign && styles.cell_center, endAlign && styles.cell_right, wrap && styles.cell_wrap)
    }), children);
  }
  TableCell.propTypes = {
    centerAlign: _pt.bool,
    children: _pt.node,
    colSpan: _pt.number,
    endAlign: _pt.bool,
    header: _pt.bool,
    startAlign: _pt.bool,
    truncate: _pt.bool,
    wrap: _pt.bool
  };