![]() 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/ |
import React from "react" import PropTypes from "prop-types" import { CopyToClipboard } from "react-copy-to-clipboard" import {SyntaxHighlighter, getStyle} from "core/syntax-highlighting" import get from "lodash/get" import { requestSnippetGenerator_curl_bash } from "../plugins/request-snippets/fn" export default class Curl extends React.Component { static propTypes = { getConfigs: PropTypes.func.isRequired, request: PropTypes.object.isRequired } render() { let { request, getConfigs } = this.props let curl = requestSnippetGenerator_curl_bash(request) const config = getConfigs() const curlBlock = get(config, "syntaxHighlight.activated") ? <SyntaxHighlighter language="bash" className="curl microlight" style={getStyle(get(config, "syntaxHighlight.theme"))} > {curl} </SyntaxHighlighter> : <textarea readOnly={true} className="curl" value={curl}></textarea> return ( <div className="curl-command"> <h4>Curl</h4> <div className="copy-to-clipboard"> <CopyToClipboard text={curl}><button/></CopyToClipboard> </div> <div> {curlBlock} </div> </div> ) } }