mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-10-29 12:40:08 +08:00
Add regex word counter
This commit is contained in:
1 parent
a18ef5b850
commit
20a734d1e1
1 file changed
+1
-1
@@ -12,7 +12,7 @@ interface TrackedTextboxProps {
|
||||
}
|
||||
|
||||
export const TrackedTextarea = (props: TrackedTextboxProps) => {
|
||||
const wordCount = props.text.split(" ").length - 1;
|
||||
const wordCount = (props.text.match(/\w+/g) || []).length;
|
||||
|
||||
let progressColor: string;
|
||||
switch (true) {
|
||||
|
||||
Reference in new issue
Block a user