import React from 'react'; // import classNames from 'classnames'; import { ContactName } from './ContactName'; import { Intl } from '../Intl'; import { LocalizerType } from '../../types/Util'; import { missingCaseError } from '../../util/missingCaseError'; interface Contact { phoneNumber: string; profileName?: string; name?: string; } interface Props { type: 'markVerified' | 'markNotVerified'; isLocal: boolean; contact: Contact; i18n: LocalizerType; } export class VerificationNotification extends React.Component { public getStringId() { const { isLocal, type } = this.props; switch (type) { case 'markVerified': return isLocal ? 'youMarkedAsVerified' : 'youMarkedAsVerifiedOtherDevice'; case 'markNotVerified': return isLocal ? 'youMarkedAsNotVerified' : 'youMarkedAsNotVerifiedOtherDevice'; default: throw missingCaseError(type); } } public renderContents() { const { contact, i18n } = this.props; const id = this.getStringId(); return ( , ]} i18n={i18n} /> ); } public render() { const { type } = this.props; const suffix = type === 'markVerified' ? 'mark-verified' : 'mark-not-verified'; return (
{this.renderContents()}
); } }