diff --git a/paperless-frontend/src/pages/UserSettingsPage.tsx b/paperless-frontend/src/pages/UserSettingsPage.tsx
index 75f03d2..f56fa0a 100644
--- a/paperless-frontend/src/pages/UserSettingsPage.tsx
+++ b/paperless-frontend/src/pages/UserSettingsPage.tsx
@@ -1,34 +1,11 @@
-import { useEffect, useState } from 'react';
+import { useEffect, useRef, useState } from 'react';
import { Button, Card, Form, Input, InputNumber, Space, Switch, Tabs, Typography, message } from 'antd';
import { CheckCircleOutlined, CloseCircleOutlined, LoadingOutlined } from '@ant-design/icons';
-import { useEditor, EditorContent } from '@tiptap/react';
-import StarterKit from '@tiptap/starter-kit';
-import Underline from '@tiptap/extension-underline';
+import { WysiwygEditor, type WysiwygEditorHandle } from '../components/WysiwygEditor';
import { userSettingsApi } from '../api/userSettings';
const { Title } = Typography;
-function TiptapToolbar({ editor }: { editor: ReturnType
}) {
- if (!editor) return null;
- const btn = (active: boolean): React.CSSProperties => ({
- padding: '2px 8px',
- border: '1px solid #d9d9d9',
- borderRadius: 4,
- cursor: 'pointer',
- background: active ? '#e6f4ff' : '#fff',
- fontWeight: active ? 600 : 400,
- });
- return (
-
-
-
-
-
-
-
- );
-}
-
function MailSettingsTab() {
const [form] = Form.useForm();
const [loading, setLoading] = useState(true);
@@ -36,11 +13,7 @@ function MailSettingsTab() {
const [testing, setTesting] = useState(false);
const [testResult, setTestResult] = useState<{ ok: boolean; error?: string } | null>(null);
const [passSet, setPassSet] = useState(false);
-
- const editor = useEditor({
- extensions: [StarterKit, Underline],
- content: '',
- });
+ const editorRef = useRef(null);
useEffect(() => {
userSettingsApi.get().then((data) => {
@@ -54,7 +27,7 @@ function MailSettingsTab() {
});
setPassSet(data.smtpPassSet);
if (data.mailSignatureHtml) {
- editor?.commands.setContent(data.mailSignatureHtml);
+ editorRef.current?.setContent(data.mailSignatureHtml);
}
}).catch(() => {
message.error('Einstellungen konnten nicht geladen werden');
@@ -74,7 +47,7 @@ function MailSettingsTab() {
smtpPass: values.smtpPass || undefined,
smtpFrom: values.smtpFrom || null,
smtpFromName: values.smtpFromName || null,
- mailSignatureHtml: editor?.getHTML() ?? null,
+ mailSignatureHtml: editorRef.current?.getHTML() ?? null,
});
setPassSet(updated.smtpPassSet);
form.setFieldValue('smtpPass', '');
@@ -126,7 +99,10 @@ function MailSettingsTab() {
-
+
@@ -136,10 +112,7 @@ function MailSettingsTab() {
-
-
-
-
+