import React from 'react';
import PropTypes from 'prop-types';
import { createNamespace } from '../../tools/namingTools';
import './styles/ListPage.scss';


const n = createNamespace('ListPage');

export const ListPage = ({
    controls,
    listing,
    sidebar
}) => (
    <React.Fragment>
        <div id="header-universal">Universal header</div>
        <div className="container">
            <div {...n('section').props}>
                <div {...n('controls').props}>{controls}</div>
                <div {...n('main').props}>
                    <div {...n('sidebar').props}>{sidebar}</div>
                    <div {...n('listing').props}>{listing}</div>
                </div>
            </div>
        </div>
    </React.Fragment>
);

ListPage.propTypes = {
    controls: PropTypes.element,
    listing: PropTypes.element,
    sidebar: PropTypes.element
};
ListPage.defaultProps = {
    controls: null,
    listing: null,
    sidebar: null
};
export default ListPage;
