import React from 'react';
import {
    OpenMainBarPanel,
    CloseMainBarPanel,
} from './styled.panel';

interface ToolBarPanelProps {
    className?: string,
    style?: React.CSSProperties,
    open: boolean,
    children?: React.ReactNode | React.ReactNode[] | any
}

export const ToolBarPanel: React.FC<ToolBarPanelProps> = ({ className, style, open, children }) => {
    return (
        open
            ? (
                <OpenMainBarPanel className={className} style={style}>
                    {children}
                </OpenMainBarPanel>
            )
            : (
                <CloseMainBarPanel className={className} style={style}>
                    {children}
                </CloseMainBarPanel>
            )
    );
}