@@ -64,8 +64,6 @@ const App: React.FC = () => {
64
64
"1.00" : "Explicitly about this context" ,
65
65
} ;
66
66
67
- const getBlockedElements = async ( tabId ) => { } ;
68
-
69
67
useEffect ( ( ) => {
70
68
const initializeGetActiveTab = async ( ) => {
71
69
const [ tab ] = await chrome . tabs . query ( {
@@ -219,19 +217,21 @@ const App: React.FC = () => {
219
217
if ( output ) {
220
218
contextScores = output . context_scores ;
221
219
}
220
+ console . log ( "Output from AI model:" , output ) ;
222
221
if ( contextScores ) {
223
222
const maxScore = Math . max ( ...Object . values ( contextScores ) ) ;
224
223
if ( maxScore <= contextScore [ 0 ] ) {
224
+ console . log ( "Unblock safe" ) ;
225
225
setUnblockSafe ( true ) ;
226
226
return ;
227
227
}
228
228
}
229
229
} catch ( err ) {
230
230
setError ( err ) ;
231
231
setHasAnalysis ( false ) ;
232
+ setUnblockSafe ( false ) ;
232
233
} finally {
233
234
setIsLoading ( false ) ;
234
- setUnblockSafe ( false ) ;
235
235
controller . abort ( ) ;
236
236
}
237
237
} ;
@@ -488,22 +488,33 @@ const App: React.FC = () => {
488
488
</ CardTitle >
489
489
</ div >
490
490
</ CardHeader >
491
- < CardContent className = "py-3 space-y-2" >
492
- < div className = "text-sm text-muted-foreground" >
493
- { unblockSafe
494
- ? "This content does not appear to be relevant to the blocked context based on surrounding text analysis."
495
- : "This content appears to be relevant to the blocked context based on surrounding text analysis." }
496
- </ div >
497
- < div className = "flex items-center gap-2 p-2 text-sm rounded-md bg-primary/10" >
498
- < AlertCircle className = "w-4 h-4 text-primary" />
499
- < span className = "text-primary" >
500
- Recommended:{ " " }
501
- { unblockSafe
502
- ? "Unblock content"
503
- : "Keep content blocked" }
504
- </ span >
505
- </ div >
506
- </ CardContent >
491
+ { unblockSafe ? (
492
+ < CardContent className = "py-3 space-y-2" >
493
+ < div className = "text-sm text-muted-foreground" >
494
+ This content does not appear to be relevant to the
495
+ blocked context based on surrounding text analysis.
496
+ </ div >
497
+ < div className = "flex items-center gap-2 p-2 text-sm rounded-md bg-primary/10" >
498
+ < AlertCircle className = "w-4 h-4 text-primary" />
499
+ < span className = "text-primary" >
500
+ Recommended: Unblock content
501
+ </ span >
502
+ </ div >
503
+ </ CardContent >
504
+ ) : (
505
+ < CardContent className = "py-3 space-y-2" >
506
+ < div className = "text-sm text-muted-foreground" >
507
+ This content appears to be relevant to the blocked
508
+ context based on surrounding text analysis.
509
+ </ div >
510
+ < div className = "flex items-center gap-2 p-2 text-sm rounded-md bg-primary/10" >
511
+ < AlertCircle className = "w-4 h-4 text-primary" />
512
+ < span className = "text-primary" >
513
+ Recommended: Keep content blocked
514
+ </ span >
515
+ </ div >
516
+ </ CardContent >
517
+ ) }
507
518
</ Card >
508
519
) : (
509
520
< Card className = "w-full bg-muted/50" >
0 commit comments