"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
var _excluded = ["className", "testId"];
var CustomByStatusElement = function CustomByStatusElement(_ref) {
  var className = _ref.className,
    _ref$testId = _ref.testId,
    testId = _ref$testId === void 0 ? 'custom-by-status-element' : _ref$testId,
    props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var context = (0, _flexibleUiContext.useFlexibleCardContext)();
  var status = context === null || context === void 0 ? void 0 : context.status;
  if (!status) {
    return null;
  }
  var component = props[status];
  if (!component) {
    return null;
  }
  return /*#__PURE__*/_react.default.createElement("span", {
    "data-separator": true,
    "data-smart-element": "custom-element",
    "data-smart-element-text": true,
    "data-testid": testId
    // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
    ,
    className: className
  }, component);
};
var _default = exports.default = CustomByStatusElement;