(currentLength: number)
| 6 | } |
| 7 | |
| 8 | const getTextColor = (currentLength: number) => { |
| 9 | const warningLimit = MAX_CHARACTERS - WARNING_THRESHOLD |
| 10 | if (currentLength > warningLimit) { |
| 11 | return 'red.500' |
| 12 | } |
| 13 | return 'gray.500' |
| 14 | } |
| 15 | |
| 16 | function TextCounter({ textLength }: TextCounterProps) { |
| 17 | return ( |