import config from '@automattic/calypso-config';
import { Count } from '@automattic/components';
import styled from '@emotion/styled';
import { Icon, chevronDown } from '@wordpress/icons';
import clsx from 'clsx';
import { localize } from 'i18n-calypso';
import PropTypes from 'prop-types';
import { Component } from 'react';
import { connect } from 'react-redux';
import isJetpackCloud from 'calypso/lib/jetpack/is-jetpack-cloud';
import {
getCurrentUserJetpackVisibleSiteCount,
getCurrentUserVisibleSiteCount,
} from 'calypso/state/current-user/selectors';
import getSites from 'calypso/state/selectors/get-sites';
import './style.scss';
const noop = () => {};
const IconContainer = styled.div( {
alignItems: 'center',
alignSelf: 'center',
borderRadius: 0,
display: 'inline-flex',
marginInlineEnd: '8px',
padding: 0,
height: '32px',
width: '32px',
justifyContent: 'center',
color: 'var(--color-sidebar-text)',
} );
class AllSites extends Component {
static defaultProps = {
onSelect: noop,
href: null,
isSelected: false,
isHighlighted: false,
showCount: true,
showIcon: false,
showChevronDownIcon: false,
domain: '',
};
static propTypes = {
onSelect: PropTypes.func,
href: PropTypes.string,
isSelected: PropTypes.bool,
isHighlighted: PropTypes.bool,
showCount: PropTypes.bool,
showIcon: PropTypes.bool,
showChevronDownIcon: PropTypes.bool,
count: PropTypes.number,
icon: PropTypes.node,
title: PropTypes.string,
domain: PropTypes.string,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
};
onSelect = ( event ) => {
this.props.onSelect( event );
};
renderIcon() {
if ( ! this.props.icon ) {
return null;
}
return