From b607d1e6283020e1076a487ce4c27477924fab63 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 23 Aug 2025 23:59:41 +0300 Subject: [PATCH] refactor(react/ribbon): shared component for labelled entry --- .../ribbon/CollectionPropertiesTab.tsx | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx index 77853e617..28f778348 100644 --- a/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx +++ b/apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx @@ -11,6 +11,7 @@ import { ParentComponent } from "../react/react_utils"; import FNote from "../../entities/fnote"; import FormCheckbox from "../react/FormCheckbox"; import FormTextBox from "../react/FormTextBox"; +import { ComponentChildren } from "preact"; const VIEW_TYPE_MAPPINGS: Record = { grid: t("book_properties.grid"), @@ -106,34 +107,38 @@ function NumberPropertyView({ note, property }: { note: FNote, property: NumberP const [ value, setValue ] = useNoteLabel(note, property.bindToLabel); return ( - <> - - + + + ) } function ComboBoxPropertyView({ note, property }: { note: FNote, property: ComboBoxProperty }) { const [ value, setValue ] = useNoteLabel(note, property.bindToLabel); + return ( + + + + ) +} + +function LabelledEntry({ label, children }: { label: string, children: ComponentChildren }) { return ( <> )