@afncdelacru/brady-chat 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -405,6 +405,15 @@ export function EnhancedBradyChat({ modeVariant = 'loan-officer', avatarSrc }: E
|
|
|
405
405
|
) : null;
|
|
406
406
|
|
|
407
407
|
if (isHidden) return null;
|
|
408
|
+
if (!bradyHealthy) {
|
|
409
|
+
return (
|
|
410
|
+
<div className="fixed top-0 right-0 w-full md:w-[360px] h-screen flex flex-col bg-gradient-to-br dark:from-zinc-900 dark:to-zinc-800 from-white to-zinc-50 border-l md:border-l dark:border-zinc-700 border-zinc-300 shadow-2xl z-[100] overflow-hidden transition-all duration-300 items-center justify-center">
|
|
411
|
+
<div className="text-center text-zinc-500 dark:text-zinc-400 text-lg font-medium">
|
|
412
|
+
Sorry, Brady AI is currently unavailable.
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
);
|
|
416
|
+
}
|
|
408
417
|
|
|
409
418
|
return (
|
|
410
419
|
<div className="fixed top-0 right-0 w-full md:w-[360px] h-screen flex flex-col bg-gradient-to-br dark:from-zinc-900 dark:to-zinc-800 from-white to-zinc-50 border-l md:border-l dark:border-zinc-700 border-zinc-300 shadow-2xl z-[100] overflow-hidden transition-all duration-300">
|
|
@@ -2,14 +2,20 @@
|
|
|
2
2
|
// Utility for integrating with AFN Brady Jr API
|
|
3
3
|
|
|
4
4
|
// Use environment variable for API key
|
|
5
|
+
// Supports both server (BRADY_API_KEY, BRADY_API_URL) and browser (NEXT_PUBLIC_BRADY_API_KEY, NEXT_PUBLIC_BRADY_API_URL)
|
|
6
|
+
// Consumers: Set NEXT_PUBLIC_BRADY_API_KEY and NEXT_PUBLIC_BRADY_API_URL in your app's .env.local for browser use
|
|
5
7
|
export const DEFAULT_BRADY_API_KEY =
|
|
6
|
-
typeof process !== 'undefined' && process.env &&
|
|
7
|
-
|
|
8
|
+
typeof process !== 'undefined' && process.env && (
|
|
9
|
+
process.env.BRADY_API_KEY || process.env.NEXT_PUBLIC_BRADY_API_KEY
|
|
10
|
+
)
|
|
11
|
+
? process.env.BRADY_API_KEY || process.env.NEXT_PUBLIC_BRADY_API_KEY
|
|
8
12
|
: '';
|
|
9
13
|
|
|
10
14
|
export const API_URL =
|
|
11
|
-
typeof process !== 'undefined' && process.env &&
|
|
12
|
-
|
|
15
|
+
typeof process !== 'undefined' && process.env && (
|
|
16
|
+
process.env.BRADY_API_URL || process.env.NEXT_PUBLIC_BRADY_API_URL
|
|
17
|
+
)
|
|
18
|
+
? process.env.BRADY_API_URL || process.env.NEXT_PUBLIC_BRADY_API_URL
|
|
13
19
|
: '';
|
|
14
20
|
|
|
15
21
|
export interface BradyMessage {
|