import React, { ComponentType } from 'react' import { PromotedIntrospection } from './PromotedIntrospection/PromotedIntrospection' export interface WithPromotedIntrospectionProps { endpoint: string apiKey?: string } export const withPromotedIntrospection = ({ endpoint, apiKey }: WithPromotedIntrospectionProps) =>

(WrappedComponent: ComponentType

) => { const WithPromotedIntrospection = (props: any) => { if (props.introspectionEnabled) { return ( ) } return } WithPromotedIntrospection.displayName = `withPromotedIntrospection(${ WrappedComponent.displayName || WrappedComponent.name || 'Component' })` return WithPromotedIntrospection }