@@ -9,6 +9,11 @@ import { SearchModeSettings } from "./search-mode"
9
9
import { useTranslation } from "react-i18next"
10
10
import { useI18n } from "@/hooks/useI18n"
11
11
import { TTSModeSettings } from "./tts-mode"
12
+ import {
13
+ exportPageAssistData ,
14
+ importPageAssistData
15
+ } from "@/libs/export-import"
16
+ import { BetaTag } from "@/components/Common/Beta"
12
17
13
18
export const SettingOther = ( ) => {
14
19
const { clearChat, speechToTextLanguage, setSpeechToTextLanguage } =
@@ -90,15 +95,15 @@ export const SettingOther = () => {
90
95
</ button >
91
96
</ div >
92
97
< SearchModeSettings />
93
- < TTSModeSettings />
98
+ < TTSModeSettings />
94
99
< div >
95
100
< div className = "mb-5" >
96
101
< h2 className = "text-base font-semibold leading-7 text-gray-900 dark:text-white" >
97
102
{ t ( "generalSettings.system.heading" ) }
98
103
</ h2 >
99
104
< div className = "border border-b border-gray-200 dark:border-gray-600 mt-3" > </ div >
100
105
</ div >
101
- < div className = "flex flex-row justify-between" >
106
+ < div className = "flex flex-row mb-3 justify-between" >
102
107
< span className = "text-gray-500 dark:text-neutral-50 " >
103
108
{ t ( "generalSettings.system.deleteChatHistory.label" ) }
104
109
</ span >
@@ -122,6 +127,37 @@ export const SettingOther = () => {
122
127
{ t ( "generalSettings.system.deleteChatHistory.button" ) }
123
128
</ button >
124
129
</ div >
130
+ < div className = "flex flex-row mb-3 justify-between" >
131
+ < span className = "text-gray-500 dark:text-neutral-50 " >
132
+ < BetaTag /> { t ( "generalSettings.system.export.label" ) }
133
+ </ span >
134
+ < button
135
+ onClick = { exportPageAssistData }
136
+ className = "bg-gray-800 dark:bg-white text-white dark:text-gray-900 px-4 py-2 rounded-md cursor-pointer" >
137
+ { t ( "generalSettings.system.export.button" ) }
138
+ </ button >
139
+ </ div >
140
+ < div className = "flex flex-row mb-3 justify-between" >
141
+ < span className = "text-gray-500 dark:text-neutral-50 " >
142
+ < BetaTag /> { t ( "generalSettings.system.import.label" ) }
143
+ </ span >
144
+ < label
145
+ htmlFor = "import"
146
+ className = "bg-gray-800 dark:bg-white text-white dark:text-gray-900 px-4 py-2 rounded-md cursor-pointer" >
147
+ { t ( "generalSettings.system.import.button" ) }
148
+ </ label >
149
+ < input
150
+ type = "file"
151
+ accept = ".json"
152
+ id = "import"
153
+ className = "hidden"
154
+ onChange = { ( e ) => {
155
+ if ( e . target . files ) {
156
+ importPageAssistData ( e . target . files [ 0 ] )
157
+ }
158
+ } }
159
+ />
160
+ </ div >
125
161
</ div >
126
162
</ dl >
127
163
)
0 commit comments