import * as React from 'react'; import { PureComponent } from 'react'; import noop from 'lodash-es/noop'; import { DatePickers } from './types'; export interface IPanelCellProps { onHover: (value: Date) => void; onSelect: (value: Date) => void; cells: DatePickers.IPanelCellValue[][]; } export default class PanelCell extends PureComponent { static defaultProps = { onHover: noop, }; onClickCell = cell => { !cell.isDisabled && this.props.onSelect(cell.value); }; getTbody() { const { cells, onHover } = this.props; return cells.map((row, i) => { const tds = row.map((col, j) => { return (
  • this.onClickCell(col)} onMouseOver={() => onHover(col.value)} className={col.className} title={col.title} > {col.text}
  • ); }); return ( ); }); } render() { return
    {this.getTbody()}
    ; } }