import React from 'react'; import cx from 'classnames'; import PropTypes from 'prop-types'; import SidebarDropdown from './SidebarDropdown'; import { translate } from 'react-i18next'; class CategoryHead extends React.Component { static propTypes = { t: PropTypes.func.isRequired, showDeletePopup: PropTypes.func.isRequired, showRenamePopup: PropTypes.func.isRequired, showAddCategoryPopup: PropTypes.func.isRequired, showAddClippingsFeedPopup: PropTypes.func.isRequired, toggleCollapse: PropTypes.func.isRequired, toggleCategoryDropdown: PropTypes.func.isRequired, toggleExportCategory: PropTypes.func.isRequired, isCategoryDropActive: PropTypes.bool.isRequired, isCategoryActive: PropTypes.bool.isRequired, hideDropDown: PropTypes.func.isRequired, parentId: PropTypes.number.isRequired, category: PropTypes.object.isRequired, categories: PropTypes.array.isRequired }; getSidebarName(name) { const catName = this.props.t(`sidebar.${name}`); if (catName === `sidebar.${name}`) { return name; } return catName; } render() { const { isCategoryActive, isCategoryDropActive, category, categories, showDeletePopup, showRenamePopup, showAddCategoryPopup, showAddClippingsFeedPopup, toggleExportCategory, hideDropDown } = this.props; const isCategoryDeletedType = category.subType === 'deleted_content'; const categoryAttrId = 'sidebar-category' + category.id; return (