import * as React from "react"; interface ITextLineComponentProps { label: string; value: string; color?: string; underline?: boolean; onLink?: () => void; } export class TextLineComponent extends React.Component { constructor(props: ITextLineComponentProps) { super(props); } onLink() { if (!this.props.onLink) { return; } this.props.onLink(); } renderContent() { if (this.props.onLink) { return (
this.onLink()}> {this.props.value || "no name"}
) } return (
{this.props.value || "no name"}
) } render() { return (
{this.props.label}
{this.renderContent()}
); } }