UNPKG

644 BJavaScriptView Raw
1import React from 'react';
2import { Cell } from 'fixed-data-table-2';
3import PropTypes from 'prop-types';
4
5export const HeaderCell = ({cellData, ...props}) => {
6 const content = cellData.main;
7
8 const style = {
9 whiteSpace: 'nowrap',
10 overflow: 'hidden',
11 textOverflow: 'ellipsis',
12 textAlign: 'left',
13 padding: '0 5px',
14 };
15
16 return (
17 <Cell {...props}>
18 <div style={style} title={content}>{content} </div>
19 </Cell>
20 );
21};
22
23HeaderCell.propTypes = {
24 columnKey: PropTypes.string.isRequired,
25 cellData: PropTypes.object.isRequired,
26 height: PropTypes.number.isRequired,
27 width: PropTypes.number.isRequired,
28};