@@ -18,6 +18,11 @@ interface CloudField {
1818 type ?: string ;
1919}
2020
21+ type TriggerInfo = {
22+ taskId ?: string ;
23+ publicAccessToken ?: string ;
24+ } ;
25+
2126interface CloudConnectionCardProps {
2227 cloudProvider : 'aws' | 'gcp' | 'azure' ;
2328 name : string ;
@@ -27,7 +32,7 @@ interface CloudConnectionCardProps {
2732 guideUrl ?: string ;
2833 color ?: string ;
2934 logoUrl ?: string ;
30- onSuccess ?: ( ) => void ;
35+ onSuccess ?: ( trigger ?: TriggerInfo ) => void ;
3136}
3237
3338export function CloudConnectionCard ( {
@@ -83,7 +88,11 @@ export function CloudConnectionCard({
8388 if ( result ?. data ?. success ) {
8489 toast . success ( `${ name } connected! Running initial scan...` ) ;
8590 setCredentials ( { } ) ;
86- onSuccess ?.( ) ;
91+ onSuccess ?.( result . data ?. trigger ) ;
92+
93+ if ( result . data ?. runErrors && result . data . runErrors . length > 0 ) {
94+ toast . error ( result . data . runErrors [ 0 ] || 'Initial scan reported an issue' ) ;
95+ }
8796 } else {
8897 toast . error ( result ?. data ?. error || 'Failed to connect' ) ;
8998 }
@@ -99,13 +108,11 @@ export function CloudConnectionCard({
99108 < Card className = "rounded-xs" >
100109 < CardHeader className = "space-y-4" >
101110 < div className = "flex items-center gap-3" >
102- < div className = { `bg-gradient-to-br ${ color } flex items-center justify-center rounded-lg p-2` } >
111+ < div
112+ className = { `bg-gradient-to-br ${ color } flex items-center justify-center rounded-lg p-2` }
113+ >
103114 { logoUrl && (
104- < img
105- src = { logoUrl }
106- alt = { `${ shortName } logo` }
107- className = "h-8 w-8 object-contain"
108- />
115+ < img src = { logoUrl } alt = { `${ shortName } logo` } className = "h-8 w-8 object-contain" />
109116 ) }
110117 </ div >
111118 < div >
0 commit comments