diff --git a/src/components/history-page/history-toolbar/history-toolbar.tsx b/src/components/history-page/history-toolbar/history-toolbar.tsx
index abfc287df..45b594b35 100644
--- a/src/components/history-page/history-toolbar/history-toolbar.tsx
+++ b/src/components/history-page/history-toolbar/history-toolbar.tsx
@@ -22,6 +22,7 @@ import { HistoryEntryOrigin } from '../../../redux/history/types'
import { importHistoryEntries, refreshHistoryState, setHistoryEntries } from '../../../redux/history/methods'
import { showErrorNotification } from '../../../redux/ui-notifications/methods'
import { useApplicationState } from '../../../hooks/common/use-application-state'
+import { cypressId } from '../../../utils/cypress-attribute'
export type HistoryToolbarChange = (newState: HistoryToolbarState) => void
@@ -223,7 +224,11 @@ export const HistoryToolbar: React.FC = ({ onSettingsChange
-
+
diff --git a/src/components/history-page/use-history-entry-title.ts b/src/components/history-page/use-history-entry-title.ts
new file mode 100644
index 000000000..f7918b9dc
--- /dev/null
+++ b/src/components/history-page/use-history-entry-title.ts
@@ -0,0 +1,21 @@
+/*
+ * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
+ *
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+import type { HistoryEntry } from '../../redux/history/types'
+import { useMemo } from 'react'
+import { useTranslation } from 'react-i18next'
+
+/**
+ * Hook that returns the title of a note in the history if present or the translation for "untitled" otherwise.
+ * @param entry The history entry containing a title property, that might be an empty string.
+ * @return A memoized string containing either the title of the entry or the translated version of "untitled".
+ */
+export const useHistoryEntryTitle = (entry: HistoryEntry): string => {
+ const { t } = useTranslation()
+ return useMemo(() => {
+ return entry.title !== '' ? entry.title : t('editor.untitledNote')
+ }, [t, entry])
+}