@@ -60,6 +60,8 @@ export default function SettingsPage() {
6060 const [ reserveSaved , setReserveSaved ] = useState ( false ) ;
6161 const [ ynabSyncHour , setYnabSyncHour ] = useState ( "6" ) ;
6262 const [ syncHourSaved , setSyncHourSaved ] = useState ( false ) ;
63+ const [ aiSummariesDisabled , setAiSummariesDisabled ] = useState ( false ) ;
64+ const [ aiSummariesSaved , setAiSummariesSaved ] = useState ( false ) ;
6365 const [ billsModeSaved , setBillsModeSaved ] = useState ( false ) ;
6466 const [ thresholds , setThresholds ] = useState ( { tight : "20" , normal : "30" , good : "50" } ) ;
6567 const [ thresholdsSaved , setThresholdsSaved ] = useState ( false ) ;
@@ -133,6 +135,9 @@ export default function SettingsPage() {
133135 if ( householdData . settings ?. ynab_sync_hour !== undefined ) {
134136 setYnabSyncHour ( String ( householdData . settings . ynab_sync_hour ) ) ;
135137 }
138+ if ( householdData . settings ?. ai_summaries_disabled !== undefined ) {
139+ setAiSummariesDisabled ( householdData . settings . ai_summaries_disabled === "1" ) ;
140+ }
136141 if ( householdData . settings ?. budget_threshold_tight ) setThresholds ( ( p ) => ( { ...p , tight : householdData . settings . budget_threshold_tight } ) ) ;
137142 if ( householdData . settings ?. budget_threshold_normal ) setThresholds ( ( p ) => ( { ...p , normal : householdData . settings . budget_threshold_normal } ) ) ;
138143 if ( householdData . settings ?. budget_threshold_good ) setThresholds ( ( p ) => ( { ...p , good : householdData . settings . budget_threshold_good } ) ) ;
@@ -1088,6 +1093,30 @@ export default function SettingsPage() {
10881093 </ CardTitle >
10891094 </ CardHeader >
10901095 < CardContent className = "form-stack" >
1096+ < div className = "form-field" >
1097+ < Label > { locale === "fi" ? "Piilota AI-yhteenvedot" : "Hide AI summaries" } </ Label >
1098+ < div className = "settings-row" >
1099+ < Switch
1100+ checked = { aiSummariesDisabled }
1101+ onCheckedChange = { async ( v ) => {
1102+ setAiSummariesDisabled ( v ) ;
1103+ await fetch ( "/api/household" , {
1104+ method : "POST" ,
1105+ headers : { "Content-Type" : "application/json" } ,
1106+ body : JSON . stringify ( { ai_summaries_disabled : v ? "1" : "0" } ) ,
1107+ } ) ;
1108+ setAiSummariesSaved ( true ) ;
1109+ setTimeout ( ( ) => setAiSummariesSaved ( false ) , 2000 ) ;
1110+ } }
1111+ />
1112+ { aiSummariesSaved && < span className = "settings-saved" > { t . common . saved } </ span > }
1113+ </ div >
1114+ < p className = "settings-help" >
1115+ { locale === "fi"
1116+ ? "Piilottaa AI-yhteenvedot ja velkasuosituksen kaikkialta sovelluksessa. Asetus on jaettu kotitalouden kaikille käyttäjille."
1117+ : "Hides AI summaries and the debt suggestion across the app. Setting is shared with all household users." }
1118+ </ p >
1119+ </ div >
10911120 { ( [
10921121 { key : "chat" as const , dbKey : "prompt_chat_guidelines" , label : locale === "fi" ? "Keskustelun ohjeet" : "Chat guidelines" } ,
10931122 { key : "summary" as const , dbKey : "prompt_summary_instructions" , label : locale === "fi" ? "Yhteenvedon ohjeet" : "Summary instructions" } ,
0 commit comments