import React from "react" import PropTypes from "prop-types" import ImPropTypes from "react-immutable-proptypes" import { sanitizeUrl } from "core/utils" import { safeBuildUrl } from "core/utils/url" import { OAS3ComponentWrapFactory } from "../helpers" const Info = (props) => { const { info, url, host, basePath, getComponent, specSelectors, externalDocs, selectedServer, url: specUrl } = props const isOpenAPI31 = specSelectors.selectIsOpenAPI31() const version = info.get("version") const description = info.get("description") const title = info.get("title") const termsOfServiceUrl = safeBuildUrl(info.get("termsOfService"), specUrl, { selectedServer }) const contact = info.get("contact") const license = info.get("license") // note that ux may want to move summary to a sub-heading, as summary is a string that does not need to be Markdown const summary = info.get("summary") // OAS3.1 field const rawExternalDocsUrl = externalDocs && externalDocs.get("url") const externalDocsUrl = safeBuildUrl(rawExternalDocsUrl, specUrl, { selectedServer }) const externalDocsDescription = externalDocs && externalDocs.get("description") const Markdown = getComponent("Markdown", true) const Link = getComponent("Link") const VersionStamp = getComponent("VersionStamp") const InfoUrl = getComponent("InfoUrl") const InfoBasePath = getComponent("InfoBasePath") const License = getComponent("License") const Contact = getComponent("Contact") return (