Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getPopupText(language) {
const millify = require('millify').default;
return `${language.name} ${millify(language.value, {precision: 1})}`;
}
const headquartersElement = itemInfo.headquarters && itemInfo.headquarters !== 'N/A' && (
<div>
<div>Headquarters</div>
<div>{itemInfo.headquarters}</div>
</div>
);
const amountElement = Number.isInteger(itemInfo.amount) && (
<div>
<div>{itemInfo.amountKind === 'funding' ? 'Funding' : 'Market Cap'}</div>
{ itemInfo.amountKind === 'funding' &&
<div>
{'$' + millify(itemInfo.amount)}
</div>
}
{ itemInfo.amountKind !== 'funding' &&
<div>
{'$' + millify(itemInfo.amount)}
</div>
}
</div>
);
const tickerElement = itemInfo.ticker && (
const newCallbacks = {...callbacks, label: function(tooltipItem, data) {
const v = data.datasets[0].data[tooltipItem.index];
const value = millify(v, {precision: 1});
const language = languages[tooltipItem.index];
return `${percents(language.value)} (${value})`;
}};
/*{