diff --git a/apps/client/src/widgets/type_widgets/options/text_notes.tsx b/apps/client/src/widgets/type_widgets/options/text_notes.tsx index 26324d0cc..9003a5230 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes.tsx +++ b/apps/client/src/widgets/type_widgets/options/text_notes.tsx @@ -10,7 +10,7 @@ import Column from "../../react/Column"; import { FormSelectGroup, FormSelectWithGroups } from "../../react/FormSelect"; import { Themes } from "@triliumnext/highlightjs"; import { ensureMimeTypesForHighlighting, loadHighlightingTheme } from "../../../services/syntax_highlight"; -import { normalizeMimeTypeForCKEditor } from "@triliumnext/commons"; +import { normalizeMimeTypeForCKEditor, type OptionNames } from "@triliumnext/commons"; import { getHtml } from "../../react/RawHtml"; import type { CSSProperties } from "preact/compat"; import FormText from "../../react/FormText"; @@ -69,26 +69,25 @@ function FormattingToolbar() { } function EditorFeatures() { - const [ textNoteEmojiCompletionEnabled, setTextNoteEmojiCompletionEnabled] = useTriliumOptionBool("textNoteEmojiCompletionEnabled"); - const [ textNoteCompletionEnabled, setTextNoteCompletionEnabled ] = useTriliumOptionBool("textNoteCompletionEnabled"); - return ( - - - + + ); } +function EditorFeature({ optionName, name, label }: { optionName: OptionNames, name: string, label: string }) { + const [ featureEnabled, setFeatureEnabled ] = useTriliumOptionBool(optionName); + + return ( + + ); +} + function HeadingStyle() { const [ headingStyle, setHeadingStyle ] = useTriliumOption("headingStyle"); @@ -152,7 +151,7 @@ function CodeBlockStyle() { const [ codeBlockWordWrap, setCodeBlockWordWrap ] = useTriliumOptionBool("codeBlockWordWrap"); return ( - +
- +
) @@ -299,10 +298,10 @@ function DateTimeFormatOptions() { }} /> - +
- @@ -316,4 +315,4 @@ function DateTimeFormatOptions() {
) -} \ No newline at end of file +}