import React from 'react';
import { Card, CardContent, Flex, Space } from '@looker/components';
import { MethodBadge, RunItHeading } from '@looker/run-it';
import { DocSummaryStatus } from '../../components';

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

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