);
}
diff --git a/frontend/src/pages/GeneralSettings/Settings/components/ChatRenderHTML/index.jsx b/frontend/src/pages/GeneralSettings/Settings/components/ChatRenderHTML/index.jsx
index 70109405..407e21ad 100644
--- a/frontend/src/pages/GeneralSettings/Settings/components/ChatRenderHTML/index.jsx
+++ b/frontend/src/pages/GeneralSettings/Settings/components/ChatRenderHTML/index.jsx
@@ -1,21 +1,21 @@
import React, { useState, useEffect } from "react";
import Appearance from "@/models/appearance";
import { useTranslation } from "react-i18next";
+import Toggle from "@/components/lib/Toggle";
export default function ChatRenderHTML() {
const { t } = useTranslation();
const [saving, setSaving] = useState(false);
const [renderHTML, setRenderHTML] = useState(false);
- const handleChange = async (e) => {
- const newValue = e.target.checked;
- setRenderHTML(newValue);
+ const handleChange = async (checked) => {
+ setRenderHTML(checked);
setSaving(true);
try {
- Appearance.updateSettings({ renderHTML: newValue });
+ Appearance.updateSettings({ renderHTML: checked });
} catch (error) {
console.error("Failed to update appearance settings:", error);
- setRenderHTML(!newValue);
+ setRenderHTML(!checked);
}
setSaving(false);
};
@@ -29,28 +29,16 @@ export default function ChatRenderHTML() {
}, []);
return (
-
-
- {t("customization.items.render-html.title")}
-
-
- {t("customization.items.render-html.description")}
-
-
+
+
);
}
diff --git a/frontend/src/pages/GeneralSettings/Settings/components/ShowScrollbar/index.jsx b/frontend/src/pages/GeneralSettings/Settings/components/ShowScrollbar/index.jsx
index 16ba073a..99081c9d 100644
--- a/frontend/src/pages/GeneralSettings/Settings/components/ShowScrollbar/index.jsx
+++ b/frontend/src/pages/GeneralSettings/Settings/components/ShowScrollbar/index.jsx
@@ -1,21 +1,21 @@
import React, { useState, useEffect } from "react";
import Appearance from "@/models/appearance";
import { useTranslation } from "react-i18next";
+import Toggle from "@/components/lib/Toggle";
export default function ShowScrollbar() {
const { t } = useTranslation();
const [saving, setSaving] = useState(false);
const [showScrollbar, setShowScrollbar] = useState(false);
- const handleChange = async (e) => {
- const newValue = e.target.checked;
- setShowScrollbar(newValue);
+ const handleChange = async (checked) => {
+ setShowScrollbar(checked);
setSaving(true);
try {
- Appearance.updateSettings({ showScrollbar: newValue });
+ Appearance.updateSettings({ showScrollbar: checked });
} catch (error) {
console.error("Failed to update appearance settings:", error);
- setShowScrollbar(!newValue);
+ setShowScrollbar(!checked);
}
setSaving(false);
};
@@ -29,28 +29,16 @@ export default function ShowScrollbar() {
}, []);
return (
-
-
- {t("customization.items.show-scrollbar.title")}
-
-
- {t("customization.items.show-scrollbar.description")}
-
-
+
+
);
}
diff --git a/frontend/src/pages/GeneralSettings/Settings/components/SpellCheck/index.jsx b/frontend/src/pages/GeneralSettings/Settings/components/SpellCheck/index.jsx
index 933c4800..95bf5d33 100644
--- a/frontend/src/pages/GeneralSettings/Settings/components/SpellCheck/index.jsx
+++ b/frontend/src/pages/GeneralSettings/Settings/components/SpellCheck/index.jsx
@@ -1,6 +1,7 @@
-import React, { useState, useEffect } from "react";
+import React, { useState } from "react";
import Appearance from "@/models/appearance";
import { useTranslation } from "react-i18next";
+import Toggle from "@/components/lib/Toggle";
export default function SpellCheck() {
const { t } = useTranslation();
@@ -9,42 +10,29 @@ export default function SpellCheck() {
Appearance.get("enableSpellCheck")
);
- const handleChange = async (e) => {
- const newValue = e.target.checked;
- setEnableSpellCheck(newValue);
+ const handleChange = async (checked) => {
+ setEnableSpellCheck(checked);
setSaving(true);
try {
- Appearance.set("enableSpellCheck", newValue);
+ Appearance.set("enableSpellCheck", checked);
} catch (error) {
console.error("Failed to update appearance settings:", error);
- setEnableSpellCheck(!newValue);
+ setEnableSpellCheck(!checked);
}
setSaving(false);
};
return (
-
-
- {t("customization.chat.spellcheck.title")}
-
-
- {t("customization.chat.spellcheck.description")}
-
-
+
+
);
}