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 33 mdiAccountMultiple ,
44 mdiClockOutline ,
55 mdiContentSaveOutline ,
6+ mdiText ,
7+ mdiFormatLetterCase ,
68} from '@mdi/js'
79import React , { useMemo , useState } from 'react'
810import Button from '../../../design/components/atoms/Button'
@@ -211,6 +213,26 @@ const DocContextMenu = ({
211213 } }
212214 />
213215 ) }
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+ ] }
214236 < BackLinksList team = { team } docs = { backLinks } />
215237 < MetadataContainerBreak />
216238 < DocContextMenuActions
Original file line number Diff line number Diff line change @@ -360,6 +360,8 @@ const enTranslation: TranslationSource = {
360360 [ lngKeys . CreatedBy ] : 'Created By' ,
361361 [ lngKeys . UpdatedBy ] : 'Updated By' ,
362362 [ lngKeys . Contributors ] : 'Contributors' ,
363+ [ lngKeys . WordCount ] : 'Word Count' ,
364+ [ lngKeys . CharacterCount ] : 'Character Count' ,
363365 [ lngKeys . History ] : 'History' ,
364366 [ lngKeys . Share ] : 'Share' ,
365367 [ lngKeys . PublicSharing ] : 'Public Sharing' ,
Original file line number Diff line number Diff line change @@ -384,6 +384,8 @@ export enum lngKeys {
384384 CreatedBy = 'Created.By' ,
385385 UpdatedBy = 'Updated.By' ,
386386 Contributors = 'Contributors' ,
387+ WordCount = 'Word.Count' ,
388+ CharacterCount = 'Character.Count' ,
387389 History = 'History' ,
388390 Share = 'Share' ,
389391 PublicSharing = 'Public.Sharing' ,
You can’t perform that action at this time.
0 commit comments