import React, {Component} from 'react'; import {Collapse, Spin} from 'antd'; import {GET_PROJECT, SHOW_APIGWPATH} from "../../../../../gql"; import gql from "graphql-tag"; import {Query} from "react-apollo"; import APIPathCardRender from "./APIPathCardRender"; import {removeSpace} from "../../../../../func"; const Panel = Collapse.Panel; class APIPathCardFetch extends Component { constructor(props) { super(props); this.state = {} } render() { return ( { ({loading, error, data}) => { if (loading) { return } if (error) { return 'error!'; } let group = '', deploy = '', path = ''; let dataProject = data.project_by_id; let {cloud_id, apiGWGroup_id, deploy_id, projectName} = dataProject; if (cloud_id !== null && cloud_id.cloudName === 'tencent') { group = apiGWGroup_id; deploy = deploy_id; } return ( { ({loading, error, data}) => { if (loading) { return } if (error) { return 'error!'; } if (data.apiGWPath_by_props.length > 0) path = data.apiGWPath_by_props[0]; return ( ) } } ) } } ) } } export default APIPathCardFetch;