import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
	Button as SemanticButton
} from 'semantic-ui-react';

import * as styles from './Style.less';

export default class TableFilter extends Component {
	static propTypes = {
		content: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
		onReset: PropTypes.func
	};

	static defaultProps = {
		onReset: null
	};

	render() {
		return (
			<div
				className={styles.TableFilter}
			>
				{this.props.content}
				{
					this.props.onReset && (
						<SemanticButton
							onClick={this.props.onReset}
						>
							Reset
						</SemanticButton>
					)
				}
			</div>
		);
	}
}
