render()

in src/search/resultsPanel/components/ResultFooter.tsx [32:83]


  render() {
    const { attributes, queryResultItem, submitFeedback } = this.props;

    const fileFormatName = attributes.FileFormat
      ? attributes.FileFormat.StringValue
      : undefined;

    let fileFormat;
    if (
      !isNullOrUndefined(fileFormatName) &&
      IgnoreFormats.indexOf(fileFormatName) === -1
    ) {
      fileFormat = (
        <div className="display-inline">
          {fileFormatName.toUpperCase()}
          <div className="file-format-divider-wrapper">
            <div className="file-format-divider" />
          </div>
        </div>
      );
    }

    let sourceLink;
    const uri = queryResultItem.DocumentURI;
    if (uri && !_.isEmpty(uri)) {
      sourceLink = (
        <div className="display-inline action-link">
          <a
            href={uri}
            onClick={this.submitClickFeedback}
            target="_blank"
            rel="noopener noreferrer"
          >
            {truncateString(uri, MAX_URI_LENGTH)}
          </a>
        </div>
      );
    }

    return (
      <div className="result-footer">
        <div className="footer-left-text">
          {fileFormat}
          {sourceLink}
        </div>
        <Feedback
          queryResultItem={queryResultItem}
          submitFeedback={submitFeedback}
        />
      </div>
    );
  }