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

import Title from './Title';


export default ({ title, hidden, buttons, filter, icon }) => {

    if (filter) {
        return (
            <div>
                <PageTitle title={ title } hidden={ hidden } titleIcon={ icon }/>
                <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">
                <Title title={ title } titleIcon={ icon }/>
            </div>
            <div className="float-right">
                { buttons }
            </div>
        </div>
    );
};
