import { isEnabled } from '@automattic/calypso-config'; import { Gridicon } from '@automattic/components'; import { translate } from 'i18n-calypso'; import { FunctionComponent } from 'react'; import Gravatar from 'calypso/components/gravatar'; import JetpackLogo from 'calypso/components/jetpack-logo'; import SocialLogo from 'calypso/components/social-logo'; import { Activity } from 'calypso/state/activity-log/types'; /** * Module constants */ export const SIZE_XS = 18; export const SIZE_S = 32; export const SIZE_M = 40; type Props = Partial< Activity > & { size?: typeof SIZE_XS | typeof SIZE_S | typeof SIZE_M; withoutInfo?: boolean; }; const ActivityActor: FunctionComponent< Props > = ( { actorAvatarUrl, actorName, actorRole, actorType, withoutInfo, size = SIZE_M, } ) => { if ( actorName === 'WordPress' && actorType === 'Application' ) { return (
{ ! withoutInfo && (
WordPress
) }
); } if ( actorName === 'Jetpack' && actorType === 'Application' ) { return (
{ isEnabled( 'jetpack/backup-simplified-screens-i4' ) && } { ! withoutInfo && (
Jetpack
) }
); } if ( actorName === 'Jetpack Boost' && actorType === 'Application' ) { return (
{ isEnabled( 'jetpack/backup-simplified-screens-i4' ) && } { ! withoutInfo && (
Jetpack Boost
) }
); } if ( actorName === 'Happiness Engineer' && actorType === 'Happiness Engineer' ) { return (
{ isEnabled( 'jetpack/backup-simplified-screens-i4' ) && } { ! withoutInfo && (
Happiness Engineer
) }
); } if ( actorType === 'Multiple' ) { return (
{ ! withoutInfo && (
{ translate( 'Multiple users' ) }
) }
); } return (
{ ! withoutInfo && (
{ actorName }
{ actorRole &&
{ actorRole }
}
) }
); }; export default ActivityActor;