import * as React from 'react'; import { themr, ThemedComponentClass } from '@friendsofreactjs/react-css-themr'; import { TABLE } from '../ThemeIdentifiers'; import * as baseTheme from './Table.scss'; import Spinner from '../Spinner'; export interface Props { callbackValue?: any; onClick?(id: number | string): void; callBackSelectedRows?(id: number): void; selectRow?: any; componentStyle?: any; componentClass?: string; isRowLoading?: boolean; theme?: any; } class TableRow extends React.PureComponent { constructor(props: Props) { super(props); this.props.callBackSelectedRows ? this.props.callBackSelectedRows(this.props.selectRow) : null; } rowClickCallback = () => { if (this.props.onClick) { this.props.onClick(this.props.callbackValue); } } render () { const { componentClass, isRowLoading = false } = this.props; return ( { this.props.children }{isRowLoading && } ); } } export default themr(TABLE, baseTheme)(TableRow) as ThemedComponentClass;