Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
get characterCount() {
const value = this.props.value || '';
const { characterLimit, warnOverLimit } = this.props;
if (!characterLimit) { return null; }
return (
);
}
get characterCount() {
const value = this.props.value || '';
if (!this.props.characterLimit) { return null; }
return (
<div data-element="character-limit">
{ I18n.t('textarea.limit.prefix', { defaultValue: 'You have used ' }) }
<span>
{ I18n.toNumber(value.length, this.i18nNumberOpts) }
</span>
{ I18n.t('textarea.limit.middle', { defaultValue: ' of ' }) }
<span>
{ I18n.toNumber(this.props.characterLimit, this.i18nNumberOpts) }
</span>
{ I18n.t('textarea.limit.suffix', { defaultValue: ' characters' }) }
</div>
);
}
get characterCount() {
const value = this.props.value || '';
const { characterLimit, warnOverLimit } = this.props;
if (!characterLimit) { return null; }
return (
);
}
get characterCount() {
const value = this.props.value || '';
if (!this.props.characterLimit) { return null; }
return (
<div data-element="character-limit">
{ I18n.t('textarea.limit.prefix', { defaultValue: 'You have used ' }) }
<span>
{ I18n.toNumber(value.length, this.i18nNumberOpts) }
</span>
{ I18n.t('textarea.limit.middle', { defaultValue: ' of ' }) }
<span>
{ I18n.toNumber(this.props.characterLimit, this.i18nNumberOpts) }
</span>
{ I18n.t('textarea.limit.suffix', { defaultValue: ' characters' }) }
</div>
);
}