import React, {PropTypes} from 'react'
import classnames from 'classnames'
import RequestGroupActionsDropdown from './../containers/RequestGroupActionsDropdown'
import SidebarRequestRow from './SidebarRequestRow'
const SidebarRequestGroupRow = ({
children,
requestGroup,
isActive,
toggleRequestGroup,
addRequestToRequestGroup
}) => {
let folderIconClass = 'fa-folder';
let expanded = !requestGroup.collapsed;
folderIconClass += !expanded ? '' : '-open';
folderIconClass += isActive ? '' : '-o';
return (
{!expanded || children.length > 0 ? null : (
{}}
isActive={false}
request={null}
requestGroup={requestGroup}
/>
)}
{expanded ? children : null}
);
};
SidebarRequestGroupRow.propTypes = {
// Functions
toggleRequestGroup: PropTypes.func.isRequired,
addRequestToRequestGroup: PropTypes.func.isRequired,
// Other
isActive: PropTypes.bool.isRequired,
requestGroup: PropTypes.object.isRequired
};
export default SidebarRequestGroupRow;