diff --git a/paperless-frontend/src/pages/SettingsPage.tsx b/paperless-frontend/src/pages/SettingsPage.tsx index be81853..eaf93aa 100644 --- a/paperless-frontend/src/pages/SettingsPage.tsx +++ b/paperless-frontend/src/pages/SettingsPage.tsx @@ -11,6 +11,7 @@ import { QrcodeOutlined, UnorderedListOutlined, PrinterOutlined, } from '@ant-design/icons'; import type { ColumnsType } from 'antd/es/table'; +import type { FormInstance } from 'antd'; import { settingsApi, type SettingDocType, type SettingPostprocessing, type SettingUserClient, @@ -1781,7 +1782,9 @@ function InboxActionsForTemplateEditor({ templateId }: { templateId: number }) { // Eingangsdokumentarten Tab (ehemals Barcode-Vorlagen) // ═══════════════════════════════════════════════════════════════════ -function LabelElementRow({ listName, remove }: { listName: number; remove: (n: number) => void }) { +function LabelElementRow({ form, listName, remove }: { form: FormInstance; listName: number; remove: (n: number) => void }) { + const type = Form.useWatch(['LabelLayout', listName, 'type'], form); + return ( - - {({ getFieldValue }) => { - const type = getFieldValue(['LabelLayout', listName, 'type']); - if (type === 'text') return ( - - - - - - - - - - ); - if (type === 'qr') return ( - - - - - - - ); - if (type === 'line') return ( - - - - - - - - ); - return null; - }} - + + {type === 'text' && ( + + + + + + + + + + )} + + {type === 'qr' && ( + + + + + + + )} + + {type === 'line' && ( + + + + + + + + )} ); } @@ -2161,7 +2161,7 @@ function BarcodeTemplatesTab() { {(layoutFields, { add: addEl, remove: removeEl }) => ( <> {layoutFields.map(({ key, name: elName }) => ( - + ))}