File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 3
3
mdiAccountMultiple ,
4
4
mdiClockOutline ,
5
5
mdiContentSaveOutline ,
6
+ mdiText ,
7
+ mdiFormatLetterCase ,
6
8
} from '@mdi/js'
7
9
import React , { useMemo , useState } from 'react'
8
10
import Button from '../../../design/components/atoms/Button'
@@ -211,6 +213,26 @@ const DocContextMenu = ({
211
213
} }
212
214
/>
213
215
) }
216
+ { currentDoc . head && [
217
+ < MetadataContainerRow
218
+ key = 'word-count'
219
+ row = { {
220
+ label : translate ( lngKeys . WordCount ) ,
221
+ type : 'content' ,
222
+ icon : mdiFormatLetterCase ,
223
+ content : currentDoc . head . content . match ( / \S + / g) ?. length || 0 ,
224
+ } }
225
+ /> ,
226
+ < MetadataContainerRow
227
+ key = 'character-count'
228
+ row = { {
229
+ label : translate ( lngKeys . CharacterCount ) ,
230
+ type : 'content' ,
231
+ icon : mdiText ,
232
+ content : currentDoc . head . content . replace ( / \s + / g, '' ) . length || 0 ,
233
+ } }
234
+ /> ,
235
+ ] }
214
236
< BackLinksList team = { team } docs = { backLinks } />
215
237
< MetadataContainerBreak />
216
238
< DocContextMenuActions
Original file line number Diff line number Diff line change @@ -360,6 +360,8 @@ const enTranslation: TranslationSource = {
360
360
[ lngKeys . CreatedBy ] : 'Created By' ,
361
361
[ lngKeys . UpdatedBy ] : 'Updated By' ,
362
362
[ lngKeys . Contributors ] : 'Contributors' ,
363
+ [ lngKeys . WordCount ] : 'Word Count' ,
364
+ [ lngKeys . CharacterCount ] : 'Character Count' ,
363
365
[ lngKeys . History ] : 'History' ,
364
366
[ lngKeys . Share ] : 'Share' ,
365
367
[ lngKeys . PublicSharing ] : 'Public Sharing' ,
Original file line number Diff line number Diff line change @@ -384,6 +384,8 @@ export enum lngKeys {
384
384
CreatedBy = 'Created.By' ,
385
385
UpdatedBy = 'Updated.By' ,
386
386
Contributors = 'Contributors' ,
387
+ WordCount = 'Word.Count' ,
388
+ CharacterCount = 'Character.Count' ,
387
389
History = 'History' ,
388
390
Share = 'Share' ,
389
391
PublicSharing = 'Public.Sharing' ,
You can’t perform that action at this time.
0 commit comments