fromUser ? localize()

in packages/component/src/Activity/CarouselFilmStrip.js [149:189]


    fromUser ? localize('ACTIVITY_YOU_SAID_ALT') : localize('ACTIVITY_BOT_SAID_ALT', botInitials || '')
  ).replace(/\s{2,}/gu, ' ');

  const initials = fromUser ? userInitials : botInitials;
  const nubOffset = fromUser ? bubbleFromUserNubOffset : bubbleNubOffset;
  const nubSize = fromUser ? bubbleFromUserNubSize : bubbleNubSize;
  const otherInitials = fromUser ? botInitials : userInitials;
  const otherNubSize = fromUser ? bubbleNubSize : bubbleFromUserNubSize;

  const hasAvatar = initials || typeof initials === 'string';
  const hasOtherAvatar = otherInitials || typeof otherInitials === 'string';
  const hasNub = typeof nubSize === 'number';
  const hasOtherNub = typeof otherNubSize === 'number';
  const topAlignedCallout = isZeroOrPositive(nubOffset);

  const extraTrailing = !hasOtherAvatar && hasOtherNub; // This is for bot message with user nub and no user avatar. And vice versa.

  const showAvatar = showCallout && hasAvatar && !!renderAvatar;
  const showNub = showCallout && hasNub && (topAlignedCallout || !attachments.length);

  const hideNub = hasNub && !showNub;

  return (
    <div
      className={classNames(
        'webchat__carousel-filmstrip',
        {
          'webchat__carousel-filmstrip--extra-trailing': extraTrailing,
          'webchat__carousel-filmstrip--hide-avatar': hasAvatar && !showAvatar,
          'webchat__carousel-filmstrip--hide-nub': hideNub,
          'webchat__carousel-filmstrip--no-message': !activityDisplayText,
          'webchat__carousel-filmstrip--rtl': direction === 'rtl',
          'webchat__carousel-filmstrip--show-avatar': showAvatar,
          'webchat__carousel-filmstrip--show-nub': showNub,
          'webchat__carousel-filmstrip--top-callout': topAlignedCallout
        },
        'react-film__filmstrip',
        rootClassName,
        carouselFilmStripStyleSet + '',
        (className || '') + ''
      )}