![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/rentpix.corals.io/vendor/swagger-api/swagger-ui/src/core/components/ |
/** * @prettier */ import React from "react" import PropTypes from "prop-types" import { safeBuildUrl } from "core/utils/url" import { sanitizeUrl } from "core/utils" class Contact extends React.Component { static propTypes = { data: PropTypes.object, getComponent: PropTypes.func.isRequired, specSelectors: PropTypes.object.isRequired, selectedServer: PropTypes.string, url: PropTypes.string.isRequired, } render() { const { data, getComponent, selectedServer, url: specUrl } = this.props const name = data.get("name", "the developer") const url = safeBuildUrl(data.get("url"), specUrl, { selectedServer }) const email = data.get("email") const Link = getComponent("Link") return ( <div className="info__contact"> {url && ( <div> <Link href={sanitizeUrl(url)} target="_blank"> {name} - Website </Link> </div> )} {email && ( <Link href={sanitizeUrl(`mailto:${email}`)}> {url ? `Send email to ${name}` : `Contact ${name}`} </Link> )} </div> ) } } export default Contact