import React from 'react'; import { UserPicture } from '@growi/ui'; import PropTypes from 'prop-types'; import UserDate from '../User/UserDate'; import Username from '../User/Username'; export default class Revision extends React.Component { componentDidMount() { } renderSimplifiedNodiff(revision) { const { t } = this.props; const author = revision.author; let pic = ''; if (typeof author === 'object') { pic = ; } return (
{pic}
({ t('No diff') })
); } renderFull(revision) { const { t } = this.props; const author = revision.author; let pic = ''; if (typeof author === 'object') { pic = ; } return (
{pic}
{this.props.isLatestRevision && Latest}

{ t('Go to this version') }
); } render() { const revision = this.props.revision; if (!this.props.hasDiff) { return this.renderSimplifiedNodiff(revision); } return this.renderFull(revision); } } Revision.propTypes = { t: PropTypes.func.isRequired, // i18next revision: PropTypes.object, isLatestRevision: PropTypes.bool.isRequired, hasDiff: PropTypes.bool.isRequired, };