<commit_before>import React from 'react';
import PropTypes from 'prop-types';
import { msgid, c } from 'ttag';
import { APPS } from 'proton-shared/lib/constants';
import { AppLink, SimpleDropdown, DropdownMenu } from '../../components';

const MemberAddresses = ({ member, addresses }) => {
    const list = addresses.map(({ ID, Email }) => (
        <div key={ID} className="w100 flex flex-nowrap pl1 pr1 pt0-5 pb0-5">
            <span className="ellipsis" title={Email}>
                {Email}
            </span>
        </div>
    ));
    const n = list.length;
    const addressesTxt = ` ${c('Info').ngettext(msgid`address`, `addresses`, n)}`;
    const contentDropDown = (
        <>
            {n}
            <span className="nomobile">{addressesTxt}</span>
        </>
    ); // trick for responsive and mobile display

    return (
        <>
            <SimpleDropdown className="pm-button--link" content={contentDropDown}>
                <div className="dropDown-item pt0-5 pb0-5 pl1 pr1 flex">
                    <AppLink
                        className="pm-button w100 aligncenter"
                        to={`/organization/${member.ID}#addresses`}
                        toApp={APPS.PROTONACCOUNT}
                    >{c('Link').t`Manage`}</AppLink>
                </div><commit_msg>[CP-1055] No link when 0 addresses<commit_after>import React from 'react';
import PropTypes from 'prop-types';
import { msgid, c } from 'ttag';
import { APPS } from 'proton-shared/lib/constants';
import { AppLink, SimpleDropdown, DropdownMenu } from '../../components';

const MemberAddresses = ({ member, addresses }) => {
    const list = addresses.map(({ ID, Email }) => (
        <div key={ID} className="w100 flex flex-nowrap pl1 pr1 pt0-5 pb0-5">
            <span className="ellipsis" title={Email}>
                {Email}
            </span>
        </div>
    ));
    const n = list.length;
    const addressesTxt = ` ${c('Info').ngettext(msgid`address`, `addresses`, n)}`;
    const contentDropDown = (
        <>
            {n}
            <span className="nomobile">{addressesTxt}</span>
        </>
    ); // trick for responsive and mobile display

    if (!n) {
        return <>{contentDropDown}</>;
    }

    return (
        <>
            <SimpleDropdown className="pm-button--link" content={contentDropDown}>
                <div className="dropDown-item pt0-5 pb0-5 pl1 pr1 flex">
                    <AppLink
                        className="pm-button w100 aligncenter"
                        to={`/organization/${member.ID}#addresses`}
                        toApp={APPS.PROTONACCOUNT}
                    >{c('Link').t`Manage`}</AppLink>
                </div>
{'fraction_non_alphanumeric': 0.1480932987782303, 'fraction_numerical': 0.015179563124768604, 'mean_word_length': 1.985635359116022, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 37, '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': '933864', 'n_tokens_mistral': 806, 'n_tokens_neox': 772, 'n_words': 178}