"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.CustomFieldsViewWidgetInline = void 0;
var _react = _interopRequireDefault(require("react"));
var _mobxReactLite = require("mobx-react-lite");
var _Skeletons = require("./Skeletons");
var _CustomFieldsViewWidgetContent = require("./CustomFieldsViewWidgetContent");
var _EmptyStateViewContent = require("./EmptyStateViewContent");
var _ErrorStateContent = require("./ErrorStateContent");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/CustomFieldsWidget/CustomFieldsViewWidgetInline.tsx";
const _CustomFieldsViewWidgetInline = ({
  dataHook,
  state,
  container,
  areAllCustomFieldsEmpty,
  extendedFields,
  userFieldsTitle
}) => {
  const {
    translate: t
  } = container;
  const getContentElement = () => {
    switch (true) {
      case state.isLoading:
        {
          return /*#__PURE__*/_react.default.createElement(_Skeletons.InlineSkeletonContent, {
            __self: void 0,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 35,
              columnNumber: 16
            }
          });
        }
      case state.isError:
        return /*#__PURE__*/_react.default.createElement(_ErrorStateContent.ErrorStateContent, {
          state: state,
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 38,
            columnNumber: 16
          }
        });
      case areAllCustomFieldsEmpty:
        return /*#__PURE__*/_react.default.createElement(_EmptyStateViewContent.EmptyStateViewContent, {
          title: t('cairo.customFields.entityPage.emptyState.title'),
          subtitle: t('cairo.customFields.entityPage.emptyState.subtitle'),
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 41,
            columnNumber: 11
          }
        });
      default:
        return /*#__PURE__*/_react.default.createElement(_CustomFieldsViewWidgetContent.CustomFieldsViewWidgetContent, {
          state: state,
          extendedFields: extendedFields,
          userFieldsTitle: userFieldsTitle,
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 49,
            columnNumber: 11
          }
        });
    }
  };
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": dataHook,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 58,
      columnNumber: 10
    }
  }, getContentElement());
};
const CustomFieldsViewWidgetInline = exports.CustomFieldsViewWidgetInline = (0, _mobxReactLite.observer)(_CustomFieldsViewWidgetInline);
//# sourceMappingURL=CustomFieldsViewWidgetInline.js.map