var _excluded = ["label", "placeholder", "selectedCount"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import styled from 'styled-components';
import { Badge, Flexbox, Typography } from '../../..';
import { ellipsis } from '../Select.styles';
var StyledTypography = styled(Typography).withConfig({
  displayName: "ValueDisplayMultiSelect__StyledTypography",
  componentId: "sc-1fihppj-0"
})(["display:block;margin-right:", "px;", ""], function (_ref) {
  var theme = _ref.theme;
  return theme.spacing.unit(2);
}, ellipsis);
export function ValueDisplayMultiSelect(props) {
  var label = props.label,
    placeholder = props.placeholder,
    selectedCount = props.selectedCount,
    rest = _objectWithoutProperties(props, _excluded);
  if (selectedCount === 0) {
    return React.createElement(StyledTypography, _extends({
      type: "secondary",
      color: function color(t) {
        return t.colorTokens.neutral.text_weak;
      }
    }, rest), placeholder);
  }
  return React.createElement(Flexbox, _extends({
    container: true,
    alignItems: "center",
    gap: 1
  }, rest), React.createElement(Flexbox, {
    item: true
  }, React.createElement(Badge.Number, {
    size: 4
  }, selectedCount)), React.createElement(Flexbox, {
    item: true
  }, React.createElement(StyledTypography, {
    type: "secondary",
    color: "inherit"
  }, label)));
}