import React from 'react'; import type { IVariableMetadata } from './PipelineTemplateReader'; import { HelpField } from '../../../help/HelpField'; import type { Placement } from '../../../presentation'; export interface IVariableMetadataHelpFieldProps { metadata: IVariableMetadata; } export class VariableMetadataHelpField extends React.Component { public render() { const content = this.getContent(); const placement: Placement = content.split('\n').length > 10 ? 'left' : 'top'; return ; } private getContent(): string { let content = ''; if (this.props.metadata.description) { content += `

${this.props.metadata.description}

`; } content += `

Type: ${this.props.metadata.type}

`; if (this.props.metadata.example) { content += `

Example:

${this.props.metadata.example}

`; } return content; } }