import classNames from 'clsx'; import React from 'react'; import { length } from 'stringz'; interface ITextCharacterCounter { max: number, text: string, } const TextCharacterCounter: React.FC = ({ text, max }) => { const checkRemainingText = (diff: number) => { return ( = 0, 'text-secondary-600': diff < 0, })} > {diff} ); }; const diff = max - length(text); return checkRemainingText(diff); }; export default TextCharacterCounter;