bigwolfe commited on
Commit
77f0b2e
·
1 Parent(s): 0c41143

Update widget component

Browse files
Files changed (1) hide show
  1. frontend/src/widget.tsx +20 -3
frontend/src/widget.tsx CHANGED
@@ -9,6 +9,7 @@ import { Loader2, AlertTriangle } from 'lucide-react';
9
 
10
  // Mock window.openai for development
11
  if (!window.openai) {
 
12
  window.openai = {
13
  toolOutput: null
14
  };
@@ -127,9 +128,25 @@ const WidgetApp = () => {
127
  )}
128
 
129
  {view === 'error' && (
130
- <div className="p-4 text-destructive">
131
- <h2 className="font-bold">Error</h2>
132
- <p>{error}</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  </div>
134
  )}
135
 
 
9
 
10
  // Mock window.openai for development
11
  if (!window.openai) {
12
+ console.warn("Mocking window.openai (dev mode)");
13
  window.openai = {
14
  toolOutput: null
15
  };
 
128
  )}
129
 
130
  {view === 'error' && (
131
+ <div className="p-4 text-destructive flex flex-col gap-4 overflow-auto">
132
+ <div>
133
+ <h2 className="font-bold">Error</h2>
134
+ <p>{error}</p>
135
+ </div>
136
+
137
+ <div className="bg-muted p-2 rounded text-xs font-mono text-foreground">
138
+ <p className="font-bold mb-1">Debug Info (window.openai):</p>
139
+ <pre className="whitespace-pre-wrap break-all">
140
+ {JSON.stringify(window.openai, null, 2)}
141
+ </pre>
142
+ </div>
143
+
144
+ <button
145
+ className="px-4 py-2 bg-primary text-primary-foreground rounded hover:opacity-90"
146
+ onClick={() => window.location.reload()}
147
+ >
148
+ Reload Widget
149
+ </button>
150
  </div>
151
  )}
152