@@ -17,6 +17,7 @@ export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme,
1717 const [ selectedIntegrationId , setSelectedIntegrationId ] = React . useState < string | null > ( null ) ;
1818 const [ selectedConfig , setSelectedConfig ] = React . useState < IntegrationConfig | null > ( null ) ;
1919 const [ message , setMessage ] = React . useState < { type : 'success' | 'error' ; text : string } | null > ( null ) ;
20+ const [ confirmDelete , setConfirmDelete ] = React . useState < string | null > ( null ) ;
2021
2122 // Handle messages from the extension
2223 React . useEffect ( ( ) => {
@@ -54,14 +55,23 @@ export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme,
5455 } ;
5556
5657 const handleDelete = ( integrationId : string ) => {
57- if ( confirm ( 'Are you sure you want to delete this integration configuration?' ) ) {
58+ setConfirmDelete ( integrationId ) ;
59+ } ;
60+
61+ const handleConfirmDelete = ( ) => {
62+ if ( confirmDelete ) {
5863 vscodeApi . postMessage ( {
5964 type : 'delete' ,
60- integrationId
65+ integrationId : confirmDelete
6166 } ) ;
67+ setConfirmDelete ( null ) ;
6268 }
6369 } ;
6470
71+ const handleCancelDelete = ( ) => {
72+ setConfirmDelete ( null ) ;
73+ } ;
74+
6575 const handleSave = ( config : IntegrationConfig ) => {
6676 vscodeApi . postMessage ( {
6777 type : 'save' ,
@@ -101,7 +111,30 @@ export const IntegrationPanel: React.FC<IIntegrationPanelProps> = ({ baseTheme,
101111 onCancel = { handleCancel }
102112 />
103113 ) }
114+
115+ { confirmDelete && (
116+ < div className = "configuration-form-overlay" >
117+ < div className = "configuration-form-container" style = { { maxWidth : '400px' } } >
118+ < div className = "configuration-form-header" >
119+ < h2 > Confirm Reset</ h2 >
120+ </ div >
121+ < div className = "configuration-form-body" >
122+ < p > Are you sure you want to reset this integration configuration?</ p >
123+ < p style = { { marginTop : '10px' , fontSize : '0.9em' , opacity : 0.8 } } >
124+ This will remove the stored credentials. You can reconfigure it later.
125+ </ p >
126+ </ div >
127+ < div className = "form-actions" >
128+ < button type = "button" className = "primary" onClick = { handleConfirmDelete } >
129+ Reset
130+ </ button >
131+ < button type = "button" className = "secondary" onClick = { handleCancelDelete } >
132+ Cancel
133+ </ button >
134+ </ div >
135+ </ div >
136+ </ div >
137+ ) }
104138 </ div >
105139 ) ;
106140} ;
107-
0 commit comments