11"use client" ;
22
3- import { useState } from "react" ;
3+ import { useCallback , useState } from "react" ;
44import { useRouter } from "next/navigation" ;
5+ import { toast } from "sonner" ;
56import { useSWRConfig } from "swr" ;
67import { deleteService } from "@/actions/projects" ;
78import { useService } from "@/components/service/service-layout-client" ;
@@ -36,6 +37,11 @@ export default function ConfigurationPage() {
3637 const { service, projectSlug, envName, proxyDomain, onUpdate } = useService ( ) ;
3738 const [ isDeleting , setIsDeleting ] = useState ( false ) ;
3839
40+ const handleConfigSave = useCallback ( ( ) => {
41+ onUpdate ( ) ;
42+ toast . info ( "Changes saved. Deploy to apply them." ) ;
43+ } , [ onUpdate ] ) ;
44+
3945 const handleDelete = async ( ) => {
4046 setIsDeleting ( true ) ;
4147 try {
@@ -49,29 +55,29 @@ export default function ConfigurationPage() {
4955
5056 return (
5157 < div className = "space-y-6" >
52- < SourceSection service = { service } onUpdate = { onUpdate } />
58+ < SourceSection service = { service } onUpdate = { handleConfigSave } />
5359
54- < ReplicasSection service = { service } onUpdate = { onUpdate } />
60+ < ReplicasSection service = { service } onUpdate = { handleConfigSave } />
5561
56- < VolumesSection service = { service } onUpdate = { onUpdate } />
62+ < VolumesSection service = { service } onUpdate = { handleConfigSave } />
5763
58- < SecretsSection service = { service } onUpdate = { onUpdate } />
64+ < SecretsSection service = { service } onUpdate = { handleConfigSave } />
5965
60- < PortsSection service = { service } onUpdate = { onUpdate } />
66+ < PortsSection service = { service } onUpdate = { handleConfigSave } />
6167
6268 < TCPProxySection
6369 service = { service }
6470 proxyDomain = { proxyDomain }
65- onUpdate = { onUpdate }
71+ onUpdate = { handleConfigSave }
6672 />
6773
68- < HealthCheckSection service = { service } onUpdate = { onUpdate } />
74+ < HealthCheckSection service = { service } onUpdate = { handleConfigSave } />
6975
70- < ResourceLimitsSection service = { service } onUpdate = { onUpdate } />
76+ < ResourceLimitsSection service = { service } onUpdate = { handleConfigSave } />
7177
72- < StartCommandSection service = { service } onUpdate = { onUpdate } />
78+ < StartCommandSection service = { service } onUpdate = { handleConfigSave } />
7379
74- < ScheduleSection service = { service } onUpdate = { onUpdate } />
80+ < ScheduleSection service = { service } onUpdate = { handleConfigSave } />
7581
7682 < div className = "space-y-3" >
7783 < h2 className = "text-xl font-semibold text-destructive" > Danger Zone</ h2 >
0 commit comments