"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.NoRecordError = exports.NoActionError = exports.NoResourceError = void 0;

var _react = _interopRequireDefault(require("react"));

var _designSystem = require("../design-system");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @class
 * Prints error message
 *
 * @component
 * @private
 * @example
 * return (
 * <ErrorMessageBox title={'Some error'}>
 *   <p>Text below the title</p>
 * </ErrorMessageBox>
 * )
 */
const ErrorMessageBox = props => {
  const {
    children,
    title,
    testId
  } = props;
  return _react.default.createElement(_designSystem.MessageBox, {
    "data-testid": testId,
    message: title
  }, _react.default.createElement(_designSystem.Text, null, children));
};

exports.default = ErrorMessageBox;

const NoResourceError = props => {
  const {
    resourceId
  } = props;
  return _react.default.createElement(_designSystem.MessageBox, {
    message: "404 - PAGE NOT FOUND",
    "data-testid": "NoResourceError",
    variant: "info",
    m: "xxl"
  }, _react.default.createElement(_designSystem.Text, null, "Resource of given id:", _react.default.createElement("b", null, ` ${resourceId} `), "cannot be found."));
};

exports.NoResourceError = NoResourceError;

const NoActionError = props => {
  const {
    resourceId,
    actionName
  } = props;
  return _react.default.createElement(_designSystem.MessageBox, {
    message: "404 - PAGE NOT FOUND",
    "data-testid": "NoActionError",
    variant: "info",
    m: "xxl"
  }, _react.default.createElement(_designSystem.Text, null, "Resource:", _react.default.createElement("b", null, ` ${resourceId} `), "does not have an action with name:", _react.default.createElement("b", null, ` ${actionName} `)));
};

exports.NoActionError = NoActionError;

const NoRecordError = props => {
  const {
    resourceId,
    recordId
  } = props;
  return _react.default.createElement(_designSystem.MessageBox, {
    message: "404 - PAGE NOT FOUND",
    "data-testid": "NoRecordError",
    variant: "info",
    m: "xxl"
  }, _react.default.createElement(_designSystem.Text, null, "Resource:", _react.default.createElement("b", null, ` ${resourceId} `), "does not have a record with id:", _react.default.createElement("b", null, ` ${recordId} `)));
};

exports.NoRecordError = NoRecordError;