import React, { Component } from 'react';
import PropTypes from 'prop-types';

import PageTitle from './PageTitle.js';

require('./title.scss');


class ListTitle extends Component {


	render() {
		let { title, hidden, buttons, filter, titleIcon } = this.props;

		if (filter) {
			return (
				<div>
					<PageTitle title={ title } hidden={ hidden } titleIcon={ titleIcon }/>
					<div className="flexTitle">
						<div className="float-left">
							{ filter }
						</div>
						<div className="float-right">
							{ buttons }
						</div>
					</div>
				</div>
			);
		}

		return (
			<div className="flexTitle">
				<div className="float-left">
					<PageTitle title={ title } hidden={ hidden } titleIcon={ titleIcon }/>
				</div>
				<div className="float-right">
					{ buttons }
				</div>
			</div>
		);
	}


}

export default ListTitle;