"use strict";

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

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

var _components = require("@looker/components");

var _runIt = require("@looker/run-it");

var _components2 = require("../../components");

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

var typeDescription = type => {
  if (type.description) return type.description;
  return "".concat(Object.entries(type.properties).length, " properties");
};

var DocTypeSummary = _ref => {
  var {
    type
  } = _ref;
  return _react.default.createElement(_components.Card, {
    maxWidth: "50rem",
    border: true
  }, _react.default.createElement(_components.CardContent, null, _react.default.createElement(_components.Space, {
    align: "start",
    between: true
  }, _react.default.createElement(_runIt.MethodBadge, {
    type: type.metaType.toString(),
    textAlign: "center",
    minWidth: "3.7625rem"
  }, type.metaType.toString().toUpperCase()), _react.default.createElement(_components.Flex, {
    alignItems: "start",
    flexDirection: "column",
    flex: "1",
    mx: "small"
  }, _react.default.createElement(_runIt.RunItHeading, {
    as: "h3",
    mb: "0",
    pt: "0"
  }, type.title || type.jsonName), _react.default.createElement(_components.Space, null, typeDescription(type))), _react.default.createElement(_components2.DocSummaryStatus, {
    status: type.status
  }))));
};

exports.DocTypeSummary = DocTypeSummary;
//# sourceMappingURL=DocTypeSummary.js.map