import * as React from "react"; interface IIndentedTextLineComponentProps { value?: string; color?: string; underline?: boolean; onLink?: () => void; url?: string; additionalClass?: string; } export class IndentedTextLineComponent extends React.Component { constructor(props: IIndentedTextLineComponentProps) { super(props); } onLink() { if (this.props.url) { window.open(this.props.url, '_blank'); return; } if (!this.props.onLink) { return; } this.props.onLink(); } renderContent() { if (this.props.onLink || this.props.url) { return (
this.onLink()}> {this.props.url ? "doc" : (this.props.value || "no name")}
) } return (
{this.props.value || "no name"}
) } render() { return (
{this.renderContent()}
); } }