text: import React from 'react';
  import T from 'prop-types';
  
  import style from 'routes/Sale/styles';
  
  import Table, {
    TableBody,
    TableCell,
    TableHead,
    TableRow,
    TableSortLabel,
  } from 'material-ui/Table';
  
  export default class EnhancedTableHead extends React.Component {
    static propTypes = {
      onRequestSort: T.func.isRequired,
      order: T.string.isRequired,
      orderBy: T.string.isRequired,
    };
  
    createSortHandler = property => event => {
      this.props.onRequestSort(event, property);
    };
  
    render() {
      const { order, orderBy, columnData } = this.props;
  
      return (
        <TableHead>
          <TableRow>
            {columnData.map(column => {
              return (
                <TableCell
                  key={column.id}
                  numeric={column.numeric}
                  padding={column.disablePadding ? 'none' : 'default'}
                >
                  {column.disableSorting ? (
                    column.label
                  ) : (
                    <TableSortLabel
                      active={orderBy === column.id}
                      direction={order}
                      onClick={this.createSortHandler(column.id)}
                    >
                      {column.label}
                    </TableSortLabel>
                  )}
                </TableCell>
              );
            }, this)}
          </TableRow>
        </TableHead>
      );
    }
  }
  