"use strict";

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

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

var _reactRouterDom = require("react-router-dom");

var _viewHelpers = _interopRequireDefault(require("../../../../backend/utils/view-helpers"));

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

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

const NoRecords = props => {
  const {
    resource
  } = props;
  const canCreate = resource.resourceActions.find(a => a.name === 'new');
  const h = new _viewHelpers.default();
  const newAction = h.resourceActionUrl({
    resourceId: resource.id,
    actionName: 'new'
  });
  return _react.default.createElement(_designSystem.InfoBox, {
    title: "No records"
  }, _react.default.createElement(_designSystem.Text, null, "There are no records in this resource."), canCreate ? _react.default.createElement(_designSystem.Text, {
    mt: "xl"
  }, _react.default.createElement(_reactRouterDom.Link, {
    to: newAction
  }, _react.default.createElement(_designSystem.Button, {
    variant: "primary",
    as: "span"
  }, _react.default.createElement(_designSystem.Icon, {
    icon: "Add"
  }), "Create First Record"))) : '');
};

var _default = NoRecords;
exports.default = _default;