import React from "react"; import styled, { css } from "styled-components"; import PropTypes from "prop-types"; import ContextMenuButton from "@appserver/components/context-menu-button"; import IconButton from "@appserver/components/icon-button"; import { isMobile } from "react-device-detect"; import { tablet } from "@appserver/components/utils/device"; const StyledContainer = styled.div` margin-left: 20px; display: flex; align-items: center; .add-button { margin-right: 12px; min-width: 17px; ${(props) => !props.isDropBox && css` @media ${tablet} { display: none; } `} ${isMobile && css` ${(props) => !props.isDropBox && "display: none"}; `} } .option-button { margin-left: auto; margin-right: 15px; min-width: 17px; } .trash-button { min-width: 17px; } `; const StyledInfoPanelToggleWrapper = styled.div` display: flex; align-items: center; align-self: center; justify-content: center; margin-left: ${({ isRootFolder }) => (isRootFolder ? "auto" : "none")}; .info-panel-toggle-bg { height: 32px; width: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background-color: ${(props) => props.isInfoPanelVisible ? "#F8F9F9" : "transparent"}; } `; const ControlButtons = ({ personal, isDropBox, isRootFolder, canCreate, getContextOptionsFolder, getContextOptionsPlus, isRecycleBinFolder, isEmptyFilesList, clearTrash, isInfoPanelVisible, toggleInfoPanel, }) => { return ( {canCreate && ( )} {isRecycleBinFolder && !isEmptyFilesList && ( )} {!isRootFolder && !personal && ( )}
); }; ControlButtons.propTypes = { personal: PropTypes.bool, isRootFolder: PropTypes.bool, canCreate: PropTypes.bool, getContextOptionsFolder: PropTypes.func, getContextOptionsPlus: PropTypes.func, }; export default React.memo(ControlButtons);