import React from "react"; import CharacterCountProps from "./CharacterCount.types"; import { Textarea } from ".."; export const CharacterCount = ({ name, id, maxLength, textareaDescriptionText, value, errorMessage, rows, autocomplete, children, maxWords, threshold, charactersUnderLimitText, charactersAtLimitText, charactersOverLimitText, wordsUnderLimitText, wordsAtLimitText, wordsOverLimitText, classes, formGroup, countMessage, spellcheck, describedBy, ...attributes }: CharacterCountProps) => { const hintSuffix = maxWords ? `${maxWords} words` : `${maxLength} characters`; const hintMessage = `You can enter up to ${hintSuffix}`; return (
{hintMessage}
); }; export default CharacterCount;