<commit_before>import * as React from 'react';

export interface IKubernetesManifestCondition {
  status: string;
  type: string;
  lastTransitionTime: string;
  message: string;
}

export interface IKubernetesManifestConditionProps {
  condition: IKubernetesManifestCondition;
}

export class ManifestCondition extends React.Component<IKubernetesManifestConditionProps> {
  public render() {
    const { condition } = this.props;
    return [
      <span key="properties">
        {condition.status === 'True' && <span style={{ marginRight: '3px' }} className="glyphicon glyphicon-Normal" />}
        {condition.status === 'False' && <span style={{ marginRight: '3px' }} className="glyphicon glyphicon-Warn" />}
        {condition.status === 'Unknown' && <span style={{ marginRight: '3px' }}>?</span>}
        <b style={{ marginRight: '3px' }}>{condition.type}</b>
        <i>{condition.lastTransitionTime}</i>
      </span>,
      <div key="message">{condition.message}</div>,
    ];
  }
}<commit_msg>feat(provider/kubernetes): show manifest condition times as relative (#5773)<commit_after>import * as React from 'react';
import * as moment from 'moment';
import { relativeTime } from '@spinnaker/core';

export interface IKubernetesManifestCondition {
  status: string;
  type: string;
  lastTransitionTime: string;
  message: string;
}

export interface IKubernetesManifestConditionProps {
  condition: IKubernetesManifestCondition;
}

export class ManifestCondition extends React.Component<IKubernetesManifestConditionProps> {
  public render() {
    const { condition } = this.props;
    const transitionTime = moment(condition.lastTransitionTime);
    return [
      <span key="properties">
        {condition.status === 'True' && <span style={{ marginRight: '3px' }} className="glyphicon glyphicon-Normal" />}
        {condition.status === 'False' && <span style={{ marginRight: '3px' }} className="glyphicon glyphicon-Warn" />}
        {condition.status === 'Unknown' && <span style={{ marginRight: '3px' }}>?</span>}
        <b style={{ marginRight: '3px' }}>{condition.type}</b>
        <i>{transitionTime.isValid() && relativeTime(transitionTime.valueOf())}</i>
      </span>,
      <div key="message">{condition.message}</div>,
    ];
  }
}
{'fraction_non_alphanumeric': 0.15350488021295475, 'fraction_numerical': 0.005323868677905945, 'mean_word_length': 4.369047619047619, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7592165', 'n_tokens_mistral': 646, 'n_tokens_neox': 647, 'n_words': 152}