import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "testId"];
import React from 'react';
import { useFlexibleCardContext } from '../../../../../state/flexible-ui-context';
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 = _objectWithoutProperties(_ref, _excluded);
  var context = 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.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);
};
export default CustomByStatusElement;