You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 1. All cases when the input box should be disabled, and an alert shown
377
+
if(!toolEnabled?.value||false){
378
+
return{
379
+
inputBox: false,
380
+
alert: {
381
+
message: toolEnabled.reason||"MinusX is not enabled for this app.",
382
+
type: "error",
383
+
title: "MinusX unavailable on this page!"
384
+
}
385
+
};
386
+
387
+
}
388
+
if(!shouldBeEnabled){
389
+
return{
390
+
inputBox: false,
391
+
alert: {
392
+
message: "You're currently using MinusX Classic, which only works on SQL Editor pages. [Find out](https://minusx.ai/demo) how to enable Agent mode and unlock all the features!",
393
+
type: "error",
394
+
title: "Try Agent Mode!"
395
+
}
396
+
};
397
+
}
398
+
399
+
if(creditsExhausted()){
400
+
return{
401
+
inputBox: false,
402
+
alert: {
403
+
message: "You've exhausted your credits for the week. You can either upgrade to a Pro subscription in settings or [talk to us](https://minusx.ai/demo) and get 1 month free Pro!",
404
+
type: "error",
405
+
title: "Uh Oh! Credits Exhausted"
406
+
}
407
+
};
408
+
}
409
+
410
+
// 2. All cases when the input box should be enabled, but an alert shown
411
+
if(toolContext.pageType==='mbql'){
412
+
return{
413
+
inputBox: true,
414
+
alert: {
415
+
message: "Question Builder feature is new and still in progress. Some things might not work just yet.",
416
+
type: "info",
417
+
title: "Try Question Builder!"
418
+
}
419
+
}
420
+
}
421
+
if(!drMode){
422
+
return{
423
+
inputBox: true,
424
+
alert: {
425
+
message: "You're currently using MinusX Classic. [Find out](https://minusx.ai/demo) how to switch to Agent Mode and unlock exciting new features!",
426
+
type: "warning",
427
+
title: "Try Agent Mode!"
428
+
}
429
+
};
430
+
}
431
+
if(creditsLow()){
432
+
return{
433
+
inputBox: true,
434
+
alert: {
435
+
message: "Running low on credits. You can either upgrade to a Pro subscription in settings or [talk to us](https://minusx.ai/demo) and get 1 month free Pro!",
436
+
type: "warning",
437
+
title: "Uh Oh! Running Low on Credits"
438
+
}
439
+
};
440
+
}
441
+
442
+
// 3. All cases when the input box should be enabled, and no alert shown
443
+
return{
444
+
inputBox: true,
445
+
alert: {
446
+
type: null,
447
+
}
448
+
};
449
+
}
450
+
451
+
constappEnabledStatus=getAlertStatus()
377
452
378
453
return(
379
454
<>
380
-
{
381
-
isAppEnabled&&!shouldBeEnabled&&<DisabledOverlaytoolEnabledReason={"You're currently using MinusX Classic, which only works on SQL Editor pages. [Find out](https://minusx.ai/demo) how to enable Agent mode and unlock all the features!"}/>
382
-
}
383
-
{/* {
384
-
analystMode && (toolContext.pageType != 'sql') && <DisabledOverlay toolEnabledReason={"You're currently using `[badge]Analyst Mode (alpha)`, which only works on SQL Editor pages for now!"}/>
<TextfontSize="xs"lineHeight={"1rem"}>You're currently using MinusX Classic. <Linkstyle={{textDecoration: 'underline'}}href="https://minusx.ai/demo"isExternal>Find out</Link> how to switch to Agent Mode and unlock exciting new features!</Text>
<TextfontSize="xs"lineHeight={"1rem"}>You've exhausted your credits for the week. You can either upgrade to a Pro subscription in <spanonClick={()=>openDevtoolTab("General Settings")}style={{textDecoration: 'underline',cursor: 'pointer'}}>settings</span> or <Linkstyle={{textDecoration: 'underline'}}href="https://minusx.ai/demo"isExternal>talk to us</Link> and get 1 month free Pro!</Text>
527
-
</Notify>
528
-
}
529
-
{
530
-
creditsLow()&&
531
-
<Notifytitle="Ooof, Running low on Credits!"notificationType='warning'>
532
-
<TextfontSize="xs"lineHeight={"1rem"}>To get more, you can either upgrade to a Pro subscription in <spanonClick={()=>openDevtoolTab("General Settings")}style={{textDecoration: 'underline',cursor: 'pointer'}}>settings</span> or <Linkstyle={{textDecoration: 'underline'}}href="https://minusx.ai/demo"isExternal>talk to us</Link> and get 1 month free Pro!</Text>
0 commit comments