"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getDropzoneBorderColor = exports.getDropzoneOpacity = exports.getDropzoneHeight = void 0;

var _branding = require("../../mixins/branding");

var getDropzoneHeight = function getDropzoneHeight(props) {
  return props.attachments && props.attachments.length > 0 ? undefined : '200px';
};

exports.getDropzoneHeight = getDropzoneHeight;

var getDropzoneOpacity = function getDropzoneOpacity(props) {
  return props.savePending ? 0.5 : 1;
};

exports.getDropzoneOpacity = getDropzoneOpacity;

var getDropzoneBorderColor = function getDropzoneBorderColor(_ref) {
  var theme = _ref.theme,
      attachmentsError = _ref.attachmentsError,
      isDragActive = _ref.isDragActive;

  if (isDragActive) {
    return (0, _branding.getPaletteColor)('greyscale-dark')({
      theme: theme
    });
  }

  if (attachmentsError != null) {
    return (0, _branding.getPaletteColor)('error-fg')({
      theme: theme
    });
  }

  return (0, _branding.getPaletteColor)('greyscale-light')({
    theme: theme
  });
};

exports.getDropzoneBorderColor = getDropzoneBorderColor;